Beispiel #1
0
static DFBResult driver_open_device(CoreInputDevice *device,
                                    unsigned int number,
                                    InputDeviceInfo *info,
                                    void **driver_data)
{
     int fd;
     MuTData *data;

     /* open device */
     fd = MuTOpenDevice (dfb_config->mut_device);
     D_INFO("MuTouch:driver_open_device %s fd %d\n", dfb_config->mut_device,fd);

     if (fd < 0) {
          return DFB_INIT;
     }

     data = D_CALLOC (1, sizeof(MuTData));
     if (!data) {
          close (fd);
          return D_OOM ();
     }

     data->fd     = fd;
     data->device = device;

     /* Must define the correct resolution of screen */
     data->screen_width  = MuT_SCREENWIDTH;
     data->screen_height = MuT_SCREENHEIGHT;

     /* The following variable are defined to adjust the orientation of
      * the touchscreen. Variables are either max screen height/width or 0.
      */
     data->min_x = MuT_MINX;
     data->min_y = MuT_MINY;

     /* fill device info structure */
     snprintf(info->desc.name, DFB_INPUT_DEVICE_DESC_NAME_LENGTH,
              "MuTouch");
     snprintf(info->desc.vendor, DFB_INPUT_DEVICE_DESC_VENDOR_LENGTH,
              "Microtouch");

     info->prefered_id     = DIDID_MOUSE;
     info->desc.type        = DIDTF_MOUSE;
     info->desc.caps        = DICAPS_AXES | DICAPS_BUTTONS;
     info->desc.max_axis   = DIAI_Y;
     info->desc.max_button = DIBI_LEFT;

     /* start input thread */
     data->thread = direct_thread_create (DTT_INPUT, MuTouchEventThread, data, "MuTouch Input");

     /* set private data pointer */
     *driver_data = data;

     return DFB_OK;
}
Beispiel #2
0
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;
}
Beispiel #3
0
int __init
libdirect_init(void)
{
     DirectResult__ctor();

     D_DEBUG_AT( Direct_Module, "%s()\n", __FUNCTION__ );

     D_INFO( "Direct/Module: Initializing module...\n" );

     return 0;
}
void
gGetDriverInfo( GraphicsDriverInfo *info )
{
     D_INFO( "DirectFB/Genefx: No software fallbacks supported\n" );

     snprintf( info->name, DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH, "Software Driver" );
     snprintf( info->vendor, DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH, "directfb.org" );

     info->version.major = 0;
     info->version.minor = 0;
}
Beispiel #5
0
static DFBResult
Test_RenderElements( IWater *water, IDirectFBSurface *surface )
{
     D_INFO( "Tests/Water: Testing RenderElements( %d )...\n", D_ARRAY_SIZE(m_test_elements) );

     /*
      * Render elements
      */
     _T( water->RenderElements( water, surface, m_test_elements, D_ARRAY_SIZE(m_test_elements) ) );

     return DFB_OK;
}
Beispiel #6
0
static DirectEnumerationResult
player_callback( void                    *ctx,
                 const VoodooPlayInfo    *info,
                 const VoodooPlayVersion *version,
                 const char              *address,
                 unsigned int             ms_since_last_seen )
{
     D_INFO( "Voodoo/Play: <%4ums> [ %-30s ]   %s%s   (vendor: %s, model: %s)\n",
             ms_since_last_seen, info->name, address, (info->flags & VPIF_LEVEL2) ? " *" : "",
             info->vendor, info->model );

     return DENUM_OK;
}
Beispiel #7
0
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;
}
Beispiel #8
0
static int check_mnt_point(const char *mpoint)
{
	printf("\n\033[34m<<<<check_mnt_point\033[0m\n");
	FILE *fp;
	struct mntent *ment;
	
	fp = setmntent("/etc/mtab", "r");

	if (fp == NULL)
	{
		D_ERROR("check_mnt_point: Failed to open /etc/mtab\n");
		return -1;
	}

	while (!feof(fp))
	{
		ment = getmntent(fp);
		
		if (ment != NULL && !strcmp(ment->mnt_dir, mpoint))
		{
			D_INFO("ment->mnt_opts:%s\n", ment->mnt_opts);
			D_INFO("ment->mnt_opts:[%c%c]\n", ment->mnt_opts[0], ment->mnt_opts[1]);
			if((ment->mnt_opts[0] == 'r') && (ment->mnt_opts[1] == 'w')) //rw: writable
			{
				D_INFO("%s\n", ment->mnt_dir);
				return 0;
			}
			else
			{
				D_INFO("\033[31mRead-only device\033[0m\n");
				return -1;
			}
		}
	}
	
	return -1;
}
Beispiel #9
0
static void
Close( VoodooLink *link )
{
     Link *l = link->priv;

     D_INFO( "Voodoo/Link: Closing connection.\n" );

     // FIXME: how to close socket?

     direct_mutex_deinit( &l->lock );

     WSACloseEvent( l->event );

     D_FREE( l );
}
Beispiel #10
0
int
main( int argc, char** argv )
{
     IDirectFB *dfb = NULL; 
     ISaWMan   *saw = NULL; 
     pid_t      pid;

     D_INFO( "SaWMan/TestRun: Initializing...\n" );

     CHECK( DirectFBInit( &argc, &argv ) );

     CHECK( DirectFBCreate( &dfb ) );

     CHECK( SaWManCreate( &saw ) );

     CHECK( saw->Start( saw, ((argc > 1) && argv[1]) ? argv[1] : "Test Application", &pid ) );

     
     D_INFO( "SaWMan/TestRun: New process has pid %d.\n", pid );


//     sleep( 2 );
//     CHECK( saw->Stop( saw, pid ) );


out:
     D_INFO( "SaWMan/TestRun: Shutting down...\n" );

     if (saw)
          saw->Release( saw );

     if (dfb)
          dfb->Release( dfb );

     return 0;
}
Beispiel #11
0
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;
#endif

     DirectLink *link;

     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;

          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 DFB_OK;
          }
     }
     Surface( EGL                  &egl,
              IDirectFB             dfb,
              int                   width,
              int                   height,
              IDirectFBEventBuffer  events )
          :
          egl( egl )
     {
          DFBSurfaceDescription desc;

          /* Fill description for a shared offscreen surface. */
          desc.flags  = (DFBSurfaceDescriptionFlags)(DSDESC_CAPS | DSDESC_WIDTH | DSDESC_HEIGHT);
          desc.caps   = (DFBSurfaceCapabilities)(DSCAPS_SHARED | DSCAPS_TRIPLE);
          desc.width  = width;
          desc.height = height;

          /* Create a primary surface. */
          surface = dfb.CreateSurface( desc );

          surface.MakeClient();

          /* Create event buffer */
          surface.AttachEventBuffer( events );

          surface_id = surface.GetID();

          surface.AllowAccess( "*" );

          surface.Clear( 0xff, 0xff, 0xff, 0xff );

          D_INFO( "DFBTest/EGLCompositor: Created new surface with ID %u\n", surface_id );

          image = egl.CreateImage( EGL_NO_CONTEXT, EGL_IMAGE_IDIRECTFBSURFACE_DIRECTFB, (EGLClientBuffer) surface.iface, NULL );

          glGenTextures( 1, &tex );

          glBindTexture( GL_TEXTURE_2D, tex );

          egl.EGLImageTargetTexture2D( GL_TEXTURE_2D, image );

          glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
          glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );


          glDisable( GL_CULL_FACE );
          glDisable( GL_DEPTH_TEST );
     }
Beispiel #13
0
DirectResult
fusion_ref_down (FusionRef *ref, bool global)
{
     D_ASSERT( ref != NULL );

     D_DEBUG_AT( Fusion_Ref, "fusion_ref_down( %p [%d]%s )\n", ref, ref->multi.id, global ? " GLOBAL" : "" );

     if (ref->multi.id == fusion_config->trace_ref) {
          D_INFO( "Fusion/Ref: 0x%08x down (%s)\n", ref->multi.id, global ? "global" : "local" );
          direct_trace_print_stack( NULL );
     }

     fusion_world_flush_calls( _fusion_world( ref->multi.shared ), 1 );

     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;
     }

// FIMXE: the following had to be commented out as the ref down may cause a ref watcher to free the memory of 'ref' (via ioctl)
#if 0
     if (ref->multi.shared)
          D_DEBUG_AT( Fusion_Ref, "  -> %d references now\n",
                      ioctl( _fusion_fd( ref->multi.shared ), FUSION_REF_STAT, &ref->multi.id ) );
     else
          D_DEBUG_AT( Fusion_Ref, "  -> destroyed\n" );
#endif

     return DR_OK;
}
Beispiel #14
0
static int driver_get_available( void )
{
  int fd;
 
  /* we will only use the ELO device if it has been configured */
  if(!dfb_config->elo_device) {
    return 0;
  }
  fd = eloOpenDevice (dfb_config->elo_device);
  if (fd < 0) {
    D_INFO("Elo:driver_get_available NON OK\n");
    return 0;
  }
  close(fd);

  return 1;
}
Beispiel #15
0
static void
Close( VoodooLink *link )
{
     Link *l = link->priv;

     D_INFO( "Voodoo/Link: Closing connection.\n" );

     close( l->fd[0] );

     if (l->fd[1] != l->fd[0])
          close( l->fd[1] );

     close( l->wakeup_fds[0] );
     close( l->wakeup_fds[1] );

     D_FREE( link->priv );
     link->priv = NULL;
}
Beispiel #16
0
static int
set_abt_max_num_xstreams(int n)
{
	char   *name = "ABT_MAX_NUM_XSTREAMS";
	char   *value;
	int	rc;

	D_ASSERTF(n > 0, "%d\n", n);
	D_ASPRINTF(value, "%d", n);
	if (value == NULL)
		return -DER_NOMEM;
	D_INFO("Setting %s to %s\n", name, value);
	rc = setenv(name, value, 1 /* overwrite */);
	D_FREE(value);
	if (rc != 0)
		return daos_errno2der(errno);
	return 0;
}
Beispiel #17
0
static void
server_fini(bool force)
{
	D_INFO("Service is shutting down\n");
	dss_module_cleanup_all();
	drpc_fini();
	if (dss_mod_facs & DSS_FAC_LOAD_CLI)
		daos_fini();
	else
		daos_hhash_fini();
	dss_srv_fini(force);
	dss_module_unload_all();
	ds_iv_fini();
	crt_finalize();
	dss_module_fini(force);
	abt_fini();
	daos_debug_fini();
}
Beispiel #18
0
static DirectResult 
fs_config_read( const char *filename )
{
     DirectResult  ret = DR_OK;
     char       line[400];
     FILE      *f;

     f = fopen( filename, "r" );
     if (!f) {
          D_DEBUG( "FusionSound/Config: "
                   "Unable to open config file `%s'!\n", filename );
          return DR_IO;
     } else {
          D_INFO( "FusionSound/Config: "
                  "Parsing config file '%s'.\n", filename );
     }

     while (fgets( line, 400, f )) {
          char *name  = line;
          char *value = strchr( line, '=' );

          if (value) {
               *value++ = 0;
               direct_trim( &value );
          }

          direct_trim( &name );

          if (!*name || *name == '#')
               continue;

          ret = fs_config_set( name, value );
          if (ret) {
               if (ret == DR_UNSUPPORTED)
                    D_ERROR( "FusionSound/Config: In config file `%s': "
                             "Invalid option `%s'!\n", filename, name );
               break;
          }
     }

     fclose( f );

     return ret;
}
Beispiel #19
0
// "ouvre" le device et commnce à le préparer :
static DFBResult driver_open_device(CoreInputDevice *device,
          unsigned int number,
          InputDeviceInfo *info,
          void **driver_data)
{
     int fd;
     ZytData *data;

     /* open device */
     fd = ZytOpenDevice (dfb_config->zytronic_device);
     D_INFO("ZYT, driver_open_device %s fd %d\n", dfb_config->zytronic_device,fd);

     if (fd < 0) {
          return DFB_INIT;
     }

     ZytActivateDevice(fd); //on configure le controleur pour fonctionner en mode normal

     data = D_CALLOC (1, sizeof(ZytData));

     data->fd     = fd;
     data->device = device;

     /* fill device info structure */
     snprintf(info->desc.name, DFB_INPUT_DEVICE_DESC_NAME_LENGTH,
               "Zypos");
     snprintf(info->desc.vendor, DFB_INPUT_DEVICE_DESC_VENDOR_LENGTH,
               "Zytronic");

     info->prefered_id     = DIDID_MOUSE;
     info->desc.type       = DIDTF_MOUSE;
     info->desc.caps       = DICAPS_AXES | DICAPS_BUTTONS;
     info->desc.max_axis   = DIAI_Y;
     info->desc.max_button = DIBI_LEFT;

     /* start input thread */
     data->thread = direct_thread_create (DTT_INPUT, ZytronicEventThread, data, "Zytronic Input");

     /* set private data pointer */
     *driver_data = data;

     return DFB_OK;
}
Beispiel #20
0
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 );
}
Beispiel #21
0
void
VoodooConnection::SetupTime()
{
     DirectResult           ret;
     VoodooResponseMessage *response;
     long long              t1, t2;

     D_DEBUG_AT( Voodoo_Connection, "VoodooConnection::%s( %p )\n", __func__, this );

     D_MAGIC_ASSERT( this, VoodooConnection );


     t1 = direct_clock_get_time( DIRECT_CLOCK_MONOTONIC );

     ret = manager->do_request( manager->remote_time_service_id, 0, VREQ_RESPOND, &response );
     if (ret) {
          D_DERROR( ret, "Voodoo/Connection: Failed to call TimeService!\n" );
          return;
     }

     t2 = direct_clock_get_time( DIRECT_CLOCK_MONOTONIC );


     VoodooMessageParser parser;
     unsigned int        high, low;
     long long           micros;

     VOODOO_PARSER_BEGIN( parser, response );
     VOODOO_PARSER_GET_UINT( parser, high );
     VOODOO_PARSER_GET_UINT( parser, low );
     VOODOO_PARSER_END( parser );

     micros = (long long) (((unsigned long long) high << 32) | low);

     delay     = t2 - t1;
     time_diff = micros - t1 - delay / 2;

     D_INFO( "Voodoo/Connection: Delay %lld us, time difference to remote is %lld us\n", delay, time_diff );

     manager->finish_request( response );
}
Beispiel #22
0
DirectResult
fusion_ref_up (FusionRef *ref, bool global)
{
     D_ASSERT( ref != NULL );

     D_DEBUG_AT( Fusion_Ref, "fusion_ref_up( %p [%d]%s )\n", ref, ref->multi.id, global ? " GLOBAL" : "" );

     if (ref->multi.id == fusion_config->trace_ref) {
          D_INFO( "Fusion/Ref: 0x%08x up (%s)\n", ref->multi.id, global ? "global" : "local" );
          direct_trace_print_stack( 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;
     }

     D_DEBUG_AT( Fusion_Ref, "  -> %d references now\n",
                 ioctl( _fusion_fd( ref->multi.shared ), FUSION_REF_STAT, &ref->multi.id ) );

     return DR_OK;
}
Beispiel #23
0
DirectResult
voodoo_client_destroy( VoodooClient *client )
{
     D_ASSERT( client != NULL );

     D_DEBUG_AT( Voodoo_Client, "%s( %p )\n", __FUNCTION__, client );

     D_INFO( "Voodoo/Client: Decreasing ref count of connection...\n" );

     if (! --(client->refs)) {
          voodoo_manager_destroy( client->manager );

          //client->vl.Close( &client->vl );

          direct_list_remove( &m_clients, &client->link );

          D_FREE( client->host );
          D_FREE( client );
     }

     return DR_OK;
}
Beispiel #24
0
static DFBResult
Test_Simple( IWater *water, IDirectFBSurface *surface )
{
     WaterScalar test_rect[4] = {{ 130 },{ 190 },{ 400 },{ 200 }};

     D_INFO( "Tests/Water: Testing SetAttribute( COLOR ) and RenderElement( RECTANGLE )...\n" );

     WaterAttributeHeader attribute;
     WaterElementHeader   element;
     WaterColor           fill_color = { 0xff, 0x20, 0x80, 0xff };
     WaterColor           draw_color = { 0xff, 0xf8, 0xf4, 0xd8 };

     /*
      * Set the fill color via SetAttribute()
      */
     attribute.type  = WAT_FILL_COLOR;
     attribute.flags = WAF_NONE;

     _T( water->SetAttribute( water, &attribute, &fill_color ) );

     /*
      * Set the draw color via SetAttribute()
      */
     attribute.type  = WAT_DRAW_COLOR;
     attribute.flags = WAF_NONE;

     _T( water->SetAttribute( water, &attribute, &draw_color ) );

     /*
      * Render a rectangle via RenderElement()
      */
     element.type   = WET_RECTANGLE;
     element.flags  = WEF_FILL | WEF_DRAW;
     element.scalar = WST_INTEGER;

     _T( water->RenderElement( water, surface, &element, test_rect, 4 ) );

     return DFB_OK;
}
Beispiel #25
0
int
main( int argc, char *argv[] )
{
     DirectResult     ret;
     VoodooTestServer test = {0};

     ret = voodoo_server_create( "127.0.0.1", 23456, false, &test.server );
     if (ret) {
          D_DERROR( ret, "voodoo_server_create() failed!\n" );
          return ret;
     }

     voodoo_server_register( test.server, "VoodooTest", VoodooTestConstruct, &test /* context pointer */ );


     D_INFO( "Voodoo/Test: Running server...\n" );

     voodoo_server_run( test.server );

     voodoo_server_destroy( test.server );

     return 0;
}
Beispiel #26
0
static DFBResult
InitPVR2D( PVR2DData *pvr2d )
{
     PVR2DERROR       ePVR2DStatus;
     PVR2DDataShared *shared = pvr2d->shared;

     pvr2d->nDevices = PVR2DEnumerateDevices(0);
     pvr2d->pDevInfo = (PVR2DDEVICEINFO *) malloc(pvr2d->nDevices * sizeof(PVR2DDEVICEINFO));
     PVR2DEnumerateDevices(pvr2d->pDevInfo);
     pvr2d->nDeviceNum = pvr2d->pDevInfo[0].ulDevID;

     ePVR2DStatus = PVR2DCreateDeviceContext (pvr2d->nDeviceNum, &pvr2d->hPVR2DContext, 0);
     if (ePVR2DStatus) {
          D_ERROR( "DirectFB/PVR2D: PVR2DCreateDeviceContext() failed! (status %d)\n", ePVR2DStatus );
          return DFB_INIT;
     }

     ePVR2DStatus = PVR2DGetFrameBuffer( pvr2d->hPVR2DContext, PVR2D_FB_PRIMARY_SURFACE, &pvr2d->pFBMemInfo);
     if (ePVR2DStatus) {
          D_ERROR( "DirectFB/PVR2D: PVR2DGetFrameBuffer() failed! (status %d)\n", ePVR2DStatus );
          return DFB_INIT;
     }

     ePVR2DStatus = PVR2DGetScreenMode(pvr2d->hPVR2DContext, &pvr2d->eDisplayFormat, &pvr2d->lDisplayWidth, &pvr2d->lDisplayHeight, &pvr2d->lStride, &pvr2d->RefreshRate);
     if (ePVR2DStatus) {
          D_ERROR( "DirectFB/PVR2D: PVR2DGetScreenMode() failed! (status %d)\n", ePVR2DStatus );
          return DFB_INIT;
     }

     D_INFO( "DirectFB/PVR2D: Display %ldx%ld, format %d, stride %ld, refresh %d\n",
             pvr2d->lDisplayWidth, pvr2d->lDisplayHeight, pvr2d->eDisplayFormat, pvr2d->lStride, pvr2d->RefreshRate );

     shared->screen_size.w = pvr2d->lDisplayWidth;
     shared->screen_size.h = pvr2d->lDisplayHeight;

     return DFB_OK;
}
Beispiel #27
0
void shjpeg_veu_set_dst_jpu(shjpeg_internal_t *data)
{
#ifdef SHJPEG_DEBUG
    u32 vdayr = shjpeg_veu_getreg32(data, VEU_VDAYR);
    u32 vdacr = shjpeg_veu_getreg32(data, VEU_VDACR);
#endif
			    
    shjpeg_veu_setreg32(data, VEU_VDAYR,
			(data->veu_linebuf) ?
			shjpeg_jpu_getreg32(data, JPU_JIFESYA2) :
			shjpeg_jpu_getreg32(data, JPU_JIFESYA1));
    shjpeg_veu_setreg32(data, VEU_VDACR,
			(data->veu_linebuf) ?
			shjpeg_jpu_getreg32(data, JPU_JIFESCA2) :
			shjpeg_jpu_getreg32(data, JPU_JIFESCA1));
    
#ifdef SHJPEG_DEBUG
    D_INFO("		-> SWAP, "
	   "VEU_VSAYR = %08x (%08x->%08x, %08x->%08x)",
	   shjpeg_veu_getreg32(data, VEU_VSAYR), vdayr,
	   shjpeg_veu_getreg32(data, VEU_VDAYR), vdacr,
	   shjpeg_veu_getreg32(data, VEU_VDACR));
#endif
}
Beispiel #28
0
// Remove all input translations over tty serial controller.
//
// set=1:  Saves current settings then turns rawmode on.
// set=0:  Restores controller to previous saved value.
//
static void tty_rawmode(int fd, int set)
{
  static struct termio tbuf, termio_save;

  int ret;

  if(set) {
    ioctl(fd, TCGETA, &termio_save);
    tbuf=termio_save;

    /* For complete explanation of the flags set/unset below, see termios(3)
       unix programmers reference manual. */

    tbuf.c_iflag = 0; /* No input processing */
    tbuf.c_oflag = 0; /* No output processing */
    tbuf.c_lflag = 0; /* Disable erase/kill, signals, and echo */

    tbuf.c_cflag = B9600|CS8|CLOCAL|CREAD;  /* Set baud & 1-char read mode */

    ret = ioctl(fd, TCSETAF, &tbuf);
    D_INFO("Elo:tty_rawmode ioctl= %d\n",ret);
  } else
    ioctl(fd, TCSETAF, &termio_save);
}
Beispiel #29
0
int init_hotplug()
{
	printf("\n\033[34m<<<<init_hotplug\033[0m\n");
	/* check if the internal, i.e. non-removable storage was mounted */
	if ((check_mnt_point(INT_STOR) == 0) && (read_dev_properties(INT_STOR, &prop_i_stor) == 0))
		s_status |= ISTORAGE_PRESENT;

	/* check if an external, i.e. removable storage was already mounted */
	if ((check_mnt_point(EXT_STOR) == 0) && (read_dev_properties(EXT_STOR, &prop_e_stor) == 0))
		s_status |= ESTORAGE_ADDED;

	if (s_status == STORAGE_NONE)
		D_WARN("init_hotplug: No internal OR external storage mounted.\n");
	
	if (open_fifo() == -1)
	{
		D_WARN("init_hotplug: open_fifo() failed. Hotplug messages will not be received.\n");
		return -1;
	}

	D_INFO("Hotplug handler initialized.\n");

	return 0;
}
int
main( int argc, char *argv[] )
{
     DirectClock clock;
     int         counter = 0;
     int         res;
     (void)res;
     /* Initialize libdirect. */
     direct_initialize();

//     direct_config->log_level = DIRECT_LOG_ALL;

     direct_log_domain_config_level( "Voodoo/Input", DIRECT_LOG_DEBUG_9 );
     direct_log_domain_config_level( "Voodoo/Output", DIRECT_LOG_DEBUG_9 );
     direct_log_domain_config_level( "Voodoo/Dispatch", DIRECT_LOG_DEBUG_9 );
     direct_log_domain_config_level( "Voodoo/Manager", DIRECT_LOG_DEBUG_9 );


     int               pipe_1[2];
     int               pipe_2[2];
//     int               socket[2];
     int               fds_server[2];
     int               fds_client[2];
     VoodooLink        voodoo_link_server;
     VoodooLink        voodoo_link_client;
     VoodooManager    *manager_server;
     VoodooManager    *manager_client;
     VoodooInstanceID  instance;

//     socketpair( PF_LOCAL, SOCK_STREAM, 0, fd );

     res = pipe( pipe_1 );
     res = pipe( pipe_2 );

     fds_server[0] = pipe_1[0];
     fds_server[1] = pipe_2[1];

     fds_client[0] = pipe_2[0];
     fds_client[1] = pipe_1[1];


     voodoo_link_init_fd( &voodoo_link_server, fds_server );
     voodoo_manager_create( &voodoo_link_server, NULL, NULL, &manager_server );

     voodoo_manager_register_local( manager_server, VOODOO_INSTANCE_NONE, NULL, NULL, Dispatch, &instance );


     voodoo_link_init_fd( &voodoo_link_client, fds_client );
     voodoo_manager_create( &voodoo_link_client, NULL, NULL, &manager_client );



     direct_clock_start( &clock );

#if !BENCH_SYNC
     do {
          voodoo_manager_request( manager_client, instance,
                                  VOODOOTEST_METHOD_ID_Push, VREQ_NONE, NULL,
                                  VMBT_INT, counter++,
                                  VMBT_NONE );
     } while (counter < NUM_ITEMS);
#else
     do {
          VoodooResponseMessage *response;

          voodoo_manager_request( manager_client, instance,
                                  VOODOOTEST_METHOD_ID_Sync, VREQ_RESPOND, &response,
                                  VMBT_NONE );

          voodoo_manager_finish_request( manager_client, response );

          counter++;
     } while (counter < NUM_ITEMS);
#endif

     {
          VoodooResponseMessage *response;

          voodoo_manager_request( manager_client, instance,
                                  VOODOOTEST_METHOD_ID_Sync, VREQ_RESPOND, &response,
                                  VMBT_NONE );

          voodoo_manager_finish_request( manager_client, response );
     }

     direct_clock_stop( &clock );


     D_INFO( "Voodoo/Test: Stopped after %lld.%03lld seconds... (%lld items/sec)\n",
             DIRECT_CLOCK_DIFF_SEC_MS( &clock ), NUM_ITEMS * 1000000ULL / direct_clock_diff( &clock ) );


     /* Shutdown libdirect. */
     direct_shutdown();

     return 0;
}