Changeset c0e8da4 in rtems


Ignore:
Timestamp:
Aug 10, 2009, 3:59:28 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
05b9f81
Parents:
e9bb4fb
Message:

2009-08-10 Roxana Leontie <roxana.leontie@…>

  • fb/fb.c: different structures defined in rtems/fb.h that were used in here so changes were needed
Location:
c/src/lib/libbsp/arm/nds
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/nds/ChangeLog

    re9bb4fb rc0e8da4  
     12009-08-10      Roxana Leontie <roxana.leontie@gmail.com>
     2
     3        * fb/fb.c: different structures defined in rtems/fb.h that were used in
     4        here so changes were needed
     5
    162009-08-10      Joel Sherrill <joel.sherrill@OARcorp.com>
    27
  • c/src/lib/libbsp/arm/nds/fb/fb.c

    re9bb4fb rc0e8da4  
    2929 */
    3030
    31 static struct fb_screeninfo fb_info = {
    32   SCREEN_WIDTH, SCREEN_HEIGHT,  /* screen size x, y  */
    33   16,                           /* bits per pixel    */
    34   SCREEN_WIDTH,                 /* pixels per line (redundant with xres ?) */
    35   (void *) VRAM_A,              /* buffer pointer    */
    36   0x18000,                      /* buffer size       */
    37   FB_TYPE_PACKED_PIXELS,        /* type of dsplay    */
    38   FB_VISUAL_TRUECOLOR           /* color scheme used */
     31static struct fb_var_screeninfo fb_var_info = {
     32  .xres                = SCREEN_WIDTH,          /* screen size x, y  */
     33  .yres                = SCREEN_HEIGHT,         
     34  .bits_per_pixel      = 16                     /* bits per pixel    */
     35};
     36
     37static struct fb_fix_screeninfo fb_fix_info = {
     38  .smem_start          = (void *) VRAM_A,            /* buffer pointer    */
     39  .smem_len            = 0x18000,                    /* buffer size       */
     40  .type                = FB_TYPE_PACKED_PIXELS,      /* type of dsplay    */
     41  .visual              = FB_VISUAL_TRUECOLOR,        /* color scheme used */
     42  .line_length         = SCREEN_WIDTH               /* pixels per line (redundant with xres ?) */
    3943};
    4044
     
    4347 */
    4448
    45 static struct fb_screeninfo fb_info2 = {
    46   SCREEN_WIDTH, SCREEN_HEIGHT,  /* screen size x, y  */
    47   16,                           /* bits per pixel    */
    48   SCREEN_WIDTH,                 /* pixels per line (redundant with xres ?) */
    49   (void *) VRAM_B,              /* buffer pointer    */
    50   0x18000,                      /* buffer size       */
    51   FB_TYPE_PACKED_PIXELS,        /* type of dsplay    */
    52   FB_VISUAL_TRUECOLOR           /* color scheme used */
     49static struct fb_var_screeninfo fb_var_info2 = {
     50  .xres                = SCREEN_WIDTH,          /* screen size x, y  */
     51  .yres                = SCREEN_HEIGHT,         
     52  .bits_per_pixel      = 16                     /* bits per pixel    */
    5353};
     54
     55static struct fb_fix_screeninfo fb_fix_info2 = {
     56  .smem_start          = (void *) VRAM_B,            /* buffer pointer    */
     57  .smem_len            = 0x18000,                    /* buffer size       */
     58  .type                = FB_TYPE_PACKED_PIXELS,      /* type of dsplay    */
     59  .visual              = FB_VISUAL_TRUECOLOR,        /* color scheme used */
     60  .line_length         = SCREEN_WIDTH               /* pixels per line (redundant with xres ?) */
     61};
     62
    5463
    5564/*
     
    8796           rtems_device_minor_number minor, void *arg)
    8897{
     98   printk ("[#] entering graphic mode on fb%d\n", minor);
     99   if (!minor) {
     100      videoSetMode (MODE_FB0);
     101      vramSetBankA (VRAM_A_LCD);
     102      memset ((void *)fb_fix_info.smem_start, 0, fb_fix_info.smem_len);
     103   } else {
     104      videoSetModeSub (MODE_FB0);
     105      vramSetBankB (VRAM_B_LCD);
     106      memset ((void *)fb_fix_info2.smem_start, 0, fb_fix_info2.smem_len);
     107    }
    89108  return RTEMS_SUCCESSFUL;
    90109}
     
    98117            rtems_device_minor_number minor, void *arg)
    99118{
     119  printk ("[#] leaving graphic mode on fb%d\n", minor);
     120  if (!minor) {
     121      memset ((void *)fb_fix_info.smem_start, 0, fb_fix_info.smem_len);
     122  }
     123  else {
     124      memset ((void *)fb_fix_info2.smem_start, 0, fb_fix_info2.smem_len);
     125      /* back to console */
     126      videoSetModeSub (MODE_0_2D | DISPLAY_BG0_ACTIVE);
     127      vramSetBankC (VRAM_C_SUB_BG);
     128  }
     129
    100130  return RTEMS_SUCCESSFUL;
    101131}
     
    142172
    143173  switch (args->command) {
    144   case FB_SCREENINFO:
    145     memcpy (args->buffer, minor ? &fb_info2 : &fb_info, sizeof (fb_info));
     174  case FBIOGET_VSCREENINFO:
     175    memcpy (args->buffer, minor ? &fb_var_info2 : &fb_var_info, sizeof (fb_var_info));
    146176    args->ioctl_return = 0;
    147177    break;
    148   case FB_GETPALETTE:
    149     args->ioctl_return = 0;     /* XXX */
     178  case FBIOGET_FSCREENINFO:
     179    memcpy (args->buffer, minor ? &fb_fix_info2 : &fb_fix_info, sizeof (fb_fix_info));
     180    args->ioctl_return = 0;
    150181    break;
    151   case FB_SETPALETTE:
    152     args->ioctl_return = 0;     /* XXX */
     182  case FBIOGETCMAP:
     183    args->ioctl_return = get_palette( args->buffer );   
     184    break;
     185  case FBIOPUTCMAP:
     186    args->ioctl_return = set_palette( args->buffer );     
    153187    break;
    154188
    155     /*
    156      * this function would execute one of the routines of the
    157      * interface based on the operation requested.
    158      */
    159   case FB_EXEC_FUNCTION:
    160     {
    161       struct fb_exec_function *env = args->buffer;
    162 
    163       switch (env->func_no) {
    164       case FB_FUNC_ENTER_GRAPHICS:
    165         /* enter graphics mode */
    166         printk ("[#] entering graphic mode on fb%d\n", minor);
    167         if (!minor) {
    168           videoSetMode (MODE_FB0);
    169           vramSetBankA (VRAM_A_LCD);
    170           memset ((void *)fb_info.smem_start, 0, fb_info.smem_len);
    171         } else {
    172           videoSetModeSub (MODE_FB0);
    173           vramSetBankB (VRAM_B_LCD);
    174           memset ((void *)fb_info2.smem_start, 0, fb_info2.smem_len);
    175         }
    176         break;
    177 
    178       case FB_FUNC_EXIT_GRAPHICS:
    179         /* leave graphics mode, in fact we only clear screen */
    180         printk ("[#] leaving graphic mode on fb%d\n", minor);
    181         if (!minor) {
    182           memset ((void *)fb_info.smem_start, 0, fb_info.smem_len);
    183         } else {
    184           memset ((void *)fb_info2.smem_start, 0, fb_info2.smem_len);
    185           /* back to console */
    186           videoSetModeSub (MODE_0_2D | DISPLAY_BG0_ACTIVE);
    187           vramSetBankC (VRAM_C_SUB_BG);
    188         }
    189         break;
    190 
    191       case FB_FUNC_IS_DIRTY:
    192         break;
    193 
    194       case FB_FUNC_GET_MODE:
    195         break;
    196 
    197       default:
    198         break;
    199       }
    200     }
    201189    /* no break on purpose */
    202190  default:
Note: See TracChangeset for help on using the changeset viewer.