Changes in uspace/srv/hid/fb/fb.c [369a5f8:19f857a] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/fb/fb.c

    r369a5f8 r19f857a  
    5959#include <stdio.h>
    6060#include <byteorder.h>
    61 #include <io/screenbuffer.h>
    6261
    6362#include "font-8x16.h"
    6463#include "fb.h"
    6564#include "main.h"
     65#include "../console/screenbuffer.h"
    6666#include "ppm.h"
    6767
     
    7272#define DEFAULT_FGCOLOR  0x000000
    7373
    74 #define GLYPH_UNAVAIL  '?'
    75 
    76 #define MAX_ANIM_LEN    8
    77 #define MAX_ANIMATIONS  4
    78 #define MAX_PIXMAPS     256  /**< Maximum number of saved pixmaps */
    79 #define MAX_VIEWPORTS   128  /**< Viewport is a rectangular area on the screen */
     74#define GLYPH_UNAVAIL    '?'
     75
     76#define MAX_ANIM_LEN     8
     77#define MAX_ANIMATIONS   4
     78#define MAX_PIXMAPS      256  /**< Maximum number of saved pixmaps */
     79#define MAX_VIEWPORTS    128  /**< Viewport is a rectangular area on the screen */
    8080
    8181/** Function to render a pixel from a RGB value. */
     
    956956        bb_cell_t *bbp;
    957957        attrs_t *a;
     958        attr_rgb_t rgb;
    958959       
    959960        for (j = 0; j < h; j++) {
     
    965966                       
    966967                        a = &data[j * w + i].attrs;
    967                        
    968                         attr_rgb_t rgb;
    969                         rgb.fg_color = 0;
    970                         rgb.bg_color = 0;
    971968                        rgb_from_attr(&rgb, a);
    972969                       
     
    15141511                rgb->bg_color = color_table[COLOR_WHITE];
    15151512                break;
    1516         case STYLE_INVERTED:
    1517                 rgb->fg_color = color_table[COLOR_WHITE];
    1518                 rgb->bg_color = color_table[COLOR_BLACK];
    1519                 break;
    1520         case STYLE_SELECTED:
    1521                 rgb->fg_color = color_table[COLOR_WHITE];
    1522                 rgb->bg_color = color_table[COLOR_RED];
    1523                 break;
    15241513        default:
    15251514                return EINVAL;
    15261515        }
    1527        
     1516
    15281517        return EOK;
    15291518}
     
    17671756        async_set_client_connection(fb_client_connection);
    17681757       
    1769         sysarg_t fb_ph_addr;
    1770         if (sysinfo_get_value("fb.address.physical", &fb_ph_addr) != EOK)
    1771                 return -1;
    1772        
    1773         sysarg_t fb_offset;
    1774         if (sysinfo_get_value("fb.offset", &fb_offset) != EOK)
    1775                 fb_offset = 0;
    1776        
    1777         sysarg_t fb_width;
    1778         if (sysinfo_get_value("fb.width", &fb_width) != EOK)
    1779                 return -1;
    1780        
    1781         sysarg_t fb_height;
    1782         if (sysinfo_get_value("fb.height", &fb_height) != EOK)
    1783                 return -1;
    1784        
    1785         sysarg_t fb_scanline;
    1786         if (sysinfo_get_value("fb.scanline", &fb_scanline) != EOK)
    1787                 return -1;
    1788        
    1789         sysarg_t fb_visual;
    1790         if (sysinfo_get_value("fb.visual", &fb_visual) != EOK)
    1791                 return -1;
    1792        
    1793         sysarg_t fbsize = fb_scanline * fb_height;
     1758        void *fb_ph_addr = (void *) sysinfo_value("fb.address.physical");
     1759        unsigned int fb_offset = sysinfo_value("fb.offset");
     1760        unsigned int fb_width = sysinfo_value("fb.width");
     1761        unsigned int fb_height = sysinfo_value("fb.height");
     1762        unsigned int fb_scanline = sysinfo_value("fb.scanline");
     1763        unsigned int fb_visual = sysinfo_value("fb.visual");
     1764
     1765        unsigned int fbsize = fb_scanline * fb_height;
    17941766        void *fb_addr = as_get_mappable_page(fbsize);
    1795        
    1796         if (physmem_map((void *) fb_ph_addr + fb_offset, fb_addr,
     1767
     1768        if (physmem_map(fb_ph_addr + fb_offset, fb_addr,
    17971769            ALIGN_UP(fbsize, PAGE_SIZE) >> PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE) != 0)
    17981770                return -1;
    1799        
     1771
    18001772        if (screen_init(fb_addr, fb_width, fb_height, fb_scanline, fb_visual))
    18011773                return 0;
    1802        
     1774
    18031775        return -1;
    18041776}
Note: See TracChangeset for help on using the changeset viewer.