Hot!Guide to create a GFX driver in Harmony 2.04

Page: < 12 Showing page 2 of 2
Author
epareja
Super Member
  • Total Posts : 351
  • Reward points : 0
  • Joined: 2003/11/07 12:53:08
  • Location: Colombia
  • Status: offline
Re: Guide to create a GFX driver in Harmony 2.04 2017/12/20 20:19:26 (permalink)
0
fgsantos7
You're right. In my code in LibAria_Initialize I have that function:
 
libariaObj.context = laContext_Create(0, 0, 0, GFX_COLOR_MODE_RGB_565, NULL);
The first argument is the driver it should be different than 0 right?


In my code it is also 0 in the driver so it´s not the problem.
 
The problem should be that you are not assigning the GFX_DriverInterfaces[idx].infoGet and GFX_DriverInterfaces[idx].contextInitialize.
 
They are assigned in the gfx_driver_def.c 

GFX_Result GFX_InitializeDriverList() {
  GFX_DriverInterfaces[0].infoGet = &ILI9325_InfoGet;
  GFX_DriverInterfaces[0].contextInitialize = &ILI9325_ContextInitialize;
  return GFX_SUCCESS;
}

 
You have to point your driver initialization functions to the GFX_DriverInterfaces.
 
My two functions are defined in the gfx_drv_ili9325.c
// function that returns the information for this driver
GFX_Result ILI9325_InfoGet(GFX_DriverInfo* info)
{
    if(info == GFX_NULL)
        return GFX_FAILURE;

    // populate info struct
    strcpy(info->name, DRIVER_NAME);
    info->color_formats = supportedColorModes;
    info->layer_count = MAX_LAYER_COUNT;

    return GFX_SUCCESS;
}

 
// function that initialized the driver context
GFX_Result ILI9325_ContextInitialize(GFX_Context* context) {
    // set driver-specific function implementations
    context->hal.initialize = &ILI9325_initialize;
    context->hal.destroy = &ILI9325_destroy;
    context->hal.brightnessRangeGet = &brightnessRangeGet;
    context->hal.brightnessSet = &brightnessSet;
    context->hal.layerActiveSet = &layerActiveSet;
    context->hal.layerEnabledSet = &layerEnabledSet;
    context->hal.layerPositionSet = &layerPositionSet;
    context->hal.layerSizeSet = &layerSizeSet;
    context->hal.layerBufferCountSet = &layerBufferCountSet;
    context->hal.layerBufferAddressSet = &layerBufferAddressSet;
    context->hal.layerBufferCoherentSet = &layerBufferCoherentSet;
    context->hal.layerBufferAllocate = &layerBufferAllocate;
    context->hal.layerBufferFree = &layerBufferFree;
    context->hal.layerVisibleSet = &layerVisibleSet;
    context->hal.layerAlphaEnableSet = &layerAlphaEnableSet;

    context->hal.drawPipeline[GFX_PIPELINE_GCU].pixelSet = &ILI9325_pixelSet;
    context->hal.drawPipeline[GFX_PIPELINE_GCU].pixelGet = &ILI9325_pixelGet;

    context->hal.drawPipeline[GFX_PIPELINE_GCUGPU].pixelSet = &ILI9325_pixelSet;
    context->hal.drawPipeline[GFX_PIPELINE_GCUGPU].pixelGet = &ILI9325_pixelGet;

    context->hal.drawPipeline[GFX_PIPELINE_GCU].drawRect[GFX_DRAW_FILL][GFX_ANTIALIAS_OFF] = &ILI9325_fillRect;
    context->hal.drawPipeline[GFX_PIPELINE_GCUGPU].drawRect[GFX_DRAW_FILL][GFX_ANTIALIAS_OFF] = &ILI9325_fillRect;
    
    context->orientation = DISP_ORIENTATION; //TODO: Esto deber?a venir de la configuraci?n del Graphic Composer

    return GFX_SUCCESS;
}



Ernesto Pareja J
www.dcctrains.netne.net

#21
Page: < 12 Showing page 2 of 2
Jump to:
© 2018 APG vNext Commercial Version 4.5