LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (http://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   Handling interrupt in FBDev driver (http://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/handling-interrupt-in-fbdev-driver-760230/)

madhuhl 10-07-2009 01:14 AM

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

sunr2007 10-08-2009 06:55 AM

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.

madhuhl 10-12-2009 12:58 AM

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 ?


All times are GMT -5. The time now is 08:58 PM.