LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices

Reply
 
LinkBack Search this Thread
Old 10-07-2009, 12:14 AM   #1
madhuhl
LQ Newbie
 
Registered: Oct 2009
Posts: 2

Rep: Reputation: 0
Handling interrupt in FBDev driver


Hi,

I am working on developing a framebuffer driver on a freescale SOC's(iMX series) LCD controller. Its Linux 2.4 kernel.
I am new to linux .
I am using the framework provided by Linux. and using fbgen.c completely without any modification.
So i have implemented all the APIs specified in skeletonfb.c

I have few doubts,

1. Where is the interrupt handled in Framebuffer driver model ?
I have EOF(end of frame) and BOF (beginning of frame ) interrupts and if i register the IRQ and define ISR, is it called automatically ?
or i have to use IOCTL's .?

2.How to handle Graphical window (overlay window)?
Frame buffer model doesnot talk about this anywhere . or I have to use DirectFB for this ?




Thanks

madhu
 
Old 10-08-2009, 05:55 AM   #2
sunr2007
Member
 
Registered: Jan 2009
Location: Bangalore , India
Distribution: Fedora 12
Posts: 65

Rep: Reputation: 17
why are u using 2.4 kernel when there is a better 2.6 kernel ? believe me framebuffer support n documentation in 2.6 is way better than 2.4 . post your code so tat we can see what are u exactly doing.
 
Old 10-11-2009, 11:58 PM   #3
madhuhl
LQ Newbie
 
Registered: Oct 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Hi, Thanks for replying....
Ya i am planning to move to 2.6 but at later stage,

I have defined init in which hardware initialisation is done and then defined these functions as given in skeletonfb.c

static struct xxxfb_info fb_info;
static struct xxxfb_par current_par;
static struct display disp;


//Hardware switch function definitions


static void xxx_detect(void)
{
return 0;
}


static int xxx_encode_fix(struct fb_fix_screeninfo *fix,
const void * _par, struct fb_info_gen * _info)
{
struct xxxfb_info *info = (struct xxxfb_info *)_info ;
struct xxxfb_par *par= (struct xxxfb_par *)_par;

memset(fix,0,sizeof(struct fb_screeninfo));

fix->smem_start = info->fb_phys;
fix->smem_len = info->fb_size;
fix->type = ;
fix->visual =;
fix->line_length = current_par.line_length;

return 0;

}


static int xxx_decode_var(const struct fb_var_screeninfo *var,
void *_par, struct fb_info_gen *_info)
{

memset(par, 0, sizeof(struct xxxfb_par));
par->var = *var;
switch (par->var->bits_per_pixel) {
case 8:
par->var->red.offset = ;
par->var->red.length = ;
par->var->green.offset = ;
par->var->green.length = ;
par->var->blue.offset = ;
par->var->blue.length = ;
par->var->transp.offset = ;
par->var->transp.length = ;
break;
case 16 :
par->var->red.offset = ;
par->var->red.length = ;
par->var->green.offset = ;
par->var->green.length = ;
par->var->blue.offset = ;
par->var->blue.length = ;
par->var->transp.offset = ;
par->var->transp.length = ;
break;
case 18:
par->var->red.offset = ;
par->var->red.length = ;
par->var->green.offset = ;
par->var->green.length = ;
par->var->blue.offset = ;
par->var->blue.length = ;
par->var->transp.offset = ;
par->var->transp.length = ;
break;
}

}


static int xxx_encode_var(struct fb_var_screeninfo *var,
const void *par, struct fb_info_gen *_info)
{
*var = ((struct xxxfb_par *) par)->var;
return 0;
}


static void xxx_get_par(void *_par, struct fb_info_gen *_info)
{
*(struct xxxfb_par *)_par = current_par;
}


static void xxx_set_par(const void *par, struct fb_info_gen *info)
{

}



static int xxx_getcolreg(unsigned regno, unsigned *red, unsigned *green,
unsigned *blue, unsigned *transp,
struct fb_info *info)
{
struct xxxfb_info *cmap_info = (struct xxxfb_info *)info;

if (regno > 255)
return 1;

*red = (unsigned short) cmap_info->palette[regno].red;
*green = (unsigned short) cmap_info->palette[regno].green;
*blue = (unsigned short) cmap_info->palette[regno].blue;
*transp = (unsigned short) cmap_info->palette[regno].transp;

return 0;
}


static int xxx_setcolreg(unsigned regno, unsigned red, unsigned green,
unsigned blue, unsigned transp,
struct fb_info *info)
{
struct xxxfb_info * cmap_info = (struct xxxfb_info *) info ;

if (regno > 255)
return 1;

else
{

if (regno < 16)
{
switch (BITS_PER_PIXEL) {
#ifdef FBCON_HAS_CFB8
case 8:
//Call to ex-feature to initialise the palette
break;
#endif
#ifdef FBCON_HAS_CFB16
case 16:
cmap_info->fbcon_cmap16[regno]=( (red & 0xFC00 )>>0 | (green & 0xFC00)>>6 | (blue & 0xFC00)>>12);
break;
default :
break;
}
}

if (regno < 255)

{
cmap_info->palette[regno].red = red >>8;
cmap_info->palette[regno].green = green >>8;
cmap_info->palette[regno].blue = blue >>8;
cmap_info->palette[regno].transp = transp>>8;
}
}

return 0;

}


static int xxx_blank(int blank_mode, struct fb_info_gen *_info)
{

switch (blank_mode) {

case VESA_NO_BLANKING:
/* turn on panel */
panel

break;

case VESA_VSYNC_SUSPEND:
case VESA_HSYNC_SUSPEND:
case VESA_POWERDOWN:
/* turn off panel */

break;
default:
break;

}
return 0;

}

/*!
* \brief
* \param[in] unused : Void pointer.
* \param[in] disp : Display structure pointer.
* \param[in] info : fb_info_gen Structure pointer.
* \return
*
*/
static void xxx_set_disp(const void *unused, struct display *disp,
struct fb_info_gen *info)
{
disp->screen_base = (char *) fb_info.fb_virt.start;

switch (disp->var.bits_per_pixel) {
#ifdef FBCON_HAS_CFB8
case 8:
disp->dispsw = &fbcon_cfb8;
break;
#endif
#ifdef FBCON_HAS_CFB18
case 18:
disp->dispsw = &fbcon_cfb16;
disp->dispsw_data = fb_info.fbcon_cmap16;
break;
default :
disp->dispsw = &fbcon_dummy;
disp->dispsw_data = NULL;
break;
}

}

/*!
* \brief
* \param[in] var : fb_var_screeninfo structure pointer.
* \param[in] info : fb_info_gen structure pointer.
* \return
*
*/
int xxx_pan_display(const struct fb_var_screeninfo *var,
struct fb_info_gen *info)
{
return 0;
}



static int xxx_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg, int con, struct fb_info *info)
{
return -EINVAL;
}


These are the API's expected by the FB layer from low level driver.
But there is no mention of handling interrupts here.

is it fine ?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
interrupt handling... culin Programming 2 02-12-2007 11:35 PM
differences between linux framebuffer driver and X fbdev driver dogalmity Programming 6 09-14-2006 08:18 PM
Interrupt handling in C vkmgeek Programming 4 02-28-2006 01:42 AM
interrupt handling mp4-10 Programming 5 02-14-2005 06:13 AM
Interrupt handling in gcc? captainstorm Programming 13 07-16-2003 05:57 AM


All times are GMT -5. The time now is 11:21 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration