Beispiel #1
0
unsigned char *einkfb_shim_alloc_kernelbuffer(unsigned long size, struct einkfb_info *info)
{
    unsigned char *result = NULL;

    if ( info->dma )
    {
        result = EINKFB_MALLOC_MOD(size, &kernelbuffer_phys);

        if ( result )
            einkfb_memset(result, EINKFB_WHITE, size);
    }

    return ( result );
}
Beispiel #2
0
static bool broadsheet_sw_init(struct fb_var_screeninfo *var, struct fb_fix_screeninfo *fix)
{
    bool result = EINKFB_FAILURE;
    bs_resolution_t res;
    
    // If we're overridden with a value other than portrait or landscape, switch us
    // back to the default.
    //
    switch ( bs_orientation )
    {
        case EINKFB_ORIENT_LANDSCAPE:
        case EINKFB_ORIENT_PORTRAIT:
        break;
        
        default:
            bs_orientation = EINKFB_ORIENT_PORTRAIT;
        break;
    }

    // Initialize enough of the hardware to ascertain the resolution we need to set up for.
    //
    bs_sw_init_controller(FULL_BRINGUP_CONTROLLER, bs_orientation, &res);
    scratchfb_size = BPP_SIZE((res.x_hw*res.y_hw), EINKFB_8BPP);
    
    broadsheet_num_ram_banks = broadsheet_get_ram_size()/BROADSHEET_RAM_BANK_SIZE;
    
    scratchfb = broadsheet_needs_dma() ? EINKFB_MALLOC_MOD(scratchfb_size, &scratchfb_phys)
                                       : vmalloc(scratchfb_size);

    if ( scratchfb )
    {
        switch ( bs_bpp )
        {
            // If we're overridden with a value other than 2, 4, or 8 bpp, switch us
            // back to the default.
            //
            default:
                bs_bpp = BPP;

            case EINKFB_2BPP:
            case EINKFB_4BPP:
            case EINKFB_8BPP:
                broadsheet_size                 = BPP_SIZE((res.x_sw*res.y_sw), bs_bpp);

                broadsheet_var.bits_per_pixel   = bs_bpp;
                
                broadsheet_fix.smem_len         = broadsheet_size;
                broadsheet_fix.line_length      = BPP_SIZE(res.x_sw, bs_bpp);
            break;
        }
        
        broadsheet_var.xres = broadsheet_var.xres_virtual = res.x_sw;
        broadsheet_var.yres = broadsheet_var.yres_virtual = res.y_sw;
        
        broadsheet_var.width  = res.x_mm;
        broadsheet_var.height = res.y_mm;

        *var = broadsheet_var;
        *fix = broadsheet_fix;
        
        result = EINKFB_SUCCESS;
    }

    return ( result );
}