Commit e79dc47e authored by Rafaël Carré's avatar Rafaël Carré Committed by Jean-Paul Saman

davinci decoder: Open Framebuffer by name (dm_vid0_fb)

Signed-off-by: Jean-Paul Saman's avatarJean-Paul Saman <jean-paul.saman@m2x.nl>
parent f152c5b2
......@@ -79,6 +79,35 @@ struct decoder_sys_t
};
static int OpenFB( const char *psz_name )
{
int i_fd = -1;
int i_tries = 0; /* begin with /dev/fb0 */
char *psz_device;
struct fb_fix_screeninfo info;
do {
if( asprintf( &psz_device, "/dev/fb%d", i_tries++ ) == -1 )
return -1;
i_fd = open( psz_device, O_RDWR);
free( psz_device );
if( i_fd == -1 )
return -1; /* check errno */
if( ioctl( i_fd, FBIOGET_FSCREENINFO, &info ) == -1 )
{
close( i_fd );
continue;
}
if( !strcmp( info.id, psz_name ) )
return i_fd;
close( i_fd );
} while(1);
}
/*****************************************************************************
* OpenDecoder: probe the decoder and return score
*****************************************************************************/
......@@ -192,7 +221,7 @@ int OpenVideoDecoder( vlc_object_t *p_this )
#ifdef DAVINCI_HACK
/* Open framebuffer */
if( ( p_sys->i_fd_fb = open( "/dev/fb1", O_RDWR ) ) == -1 )
if( ( p_sys->i_fd_fb = OpenFB( "dm_vid0_fb" ) ) == -1 )
{
msg_Err( p_dec, "Failed to open framebuffer (%m)" );
goto error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment