Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Memory organization of driver for graphics hardware with fixed multiple layers: (2 Items)
   
Memory organization of driver for graphics hardware with fixed multiple layers  
Hi,

I'm writing a Photon graphic driver with support for layers. My target
graphical device supports multiple layers but their number and
organization (starting physical address, layer format ,stride...) is
predefined and fixed in hardware (FPGA) configuration.
I'm thinking to organize the driver memory context (adapter->mm_ctx) in
a way that I have several memory pools, one for each layer.
e.g. 
#define MAX_LAYERS 5
typedef struct {
    unsigned num_layers;
    disp_vm_pool_t *layerPools[MAX_LAYERS];
}XX_mm_ctx_t;

mem_reset would initialize pools for all layers
alloc_surface would allocate memory from layer pool of default layer, or
system ram
alloc_layer_surface would allocate memory from respective layer pool


I'm new to QNX drivers and I'm not sure if this approach is reasonable
in case of such predefined layers.


Thanks,
Goran Pantar
Re: Memory organization of driver for graphics hardware with fixed multiple layers  
Your approach is correct.  If you need to allocate memory from specifiic memory areas with specific stride etc.  you 
will want to create a specific memory pool for each.  

The when your alloc_layer_surface() function is called the surface can be allocated from the pool that corresponds to 
the specific layer.

You may then want your alloc_surface() function to fail if the request is not for a DISPLAYABLE surface.