From: <chr...@ph...> - 2001-07-26 07:45:31
|
Hello, I have to write a fb (!?) on embedded system. I will certainly reuse the sa1100fb.c frame buffer. Can someone explain the difference between the following examples : In some framebuffer drivers there is : either: ************************* Ex 1 (from sa1100fb.c) static struct fb_ops sa1100fb_ops = { owner: THIS_MODULE, fb_get_fix: sa1100fb_get_fix, fb_get_var: sa1100fb_get_var, fb_set_var: sa1100fb_set_var, fb_get_cmap: sa1100fb_get_cmap, fb_set_cmap: sa1100fb_set_cmap, }; with sa1100fb_encode_fix(), sa1100fb_getcolreg(), sa1100fb_setcolreg() etc, defined which could belong to the fbgen_hwswitch struct. or: ************************* Ex 2 (from pm2fb.c) static struct fbgen_hwswitch pm2fb_hwswitch={ pm2fb_detect, pm2fb_encode_fix, pm2fb_decode_var, pm2fb_encode_var, pm2fb_get_par, pm2fb_set_par, pm2fb_getcolreg, pm2fb_setcolreg, pm2fb_pan_display, pm2fb_blank, pm2fb_set_disp }; static struct fb_ops pm2fb_ops={ owner: THIS_MODULE, fb_get_fix: fbgen_get_fix, fb_get_var: fbgen_get_var, fb_set_var: fbgen_set_var, fb_get_cmap: fbgen_get_cmap, fb_set_cmap: fbgen_set_cmap, fb_pan_display: fbgen_pan_display, }; ___________________________________________________ So in Ex1 why not defining the sa1100fb_hwswitch variable ??? Or when do you define xxxxfb_hwswitch variable and put fbgen_xxx functions in xxxxfb_ops var (like ex2) rather than writing function for only xxxxfb_ops (like ex 1) ? ThanX Christophe Levantis |