GPU module

The GPU module is a dynamically linked library that is loaded by the Screen resource manager only when hardware rendering is required (e.g., when an application makes an EGL or hardware rendering API call, or if the composition of the framebuffer has a dependency on the GPU stack). The Screen resource manager, as part of its boot optimization strategy, loads and starts drivers only when necessary, rather than at Screen's initialization time. The GPU module is one of these drivers that Screen starts on an as-needed basis.

The GPU module is configured with the gpu-dlls parameter under the egl display section of the configuration file (graphics.conf). Configuration of the GPU module is optional. However, if there is a GPU on the target hardware, it's best to configure gpu-dlls to optimize performance. If you configure the GPU module, then Screen can use the GPU rather than the CPU. Also, if the configuration file specifies a hardware blitter as the composition module (i.e., a hardware blitter is configured in the blit-dll parameter of the egl display section), then you must configure gpu-dlls.

The following image illustrates the Screen architecture GPU module:

Functionality

The GPU module is responsible for initializing the GPU stack, cleaning up, and exiting gracefully.

Interfaces

The GPU module needs to define functions specified in screen/gpu.h.

The following GPU module interactions are associated with the following graphics components:

Module/Component Interface Description
Screen resource manager Function call

The Screen resource manager accesses the GPU through these following interfaces:

int win_gpu_module_init(int index)
The Screen resource manager calls this function when the client triggers an operation such as an EGL or OpenGL ES API call.
static void win_gpu_modules_fini(void)
This function is called when Screen resource manager exits.
Blit Function call The blit module calls directly to the GPU through other interfaces provided by the GPU hardware. The interface between the blit module and GPU is platform-dependent.
Composition Function call The composition module calls directly to the GPU through other interfaces provided by the GPU hardware. The interface between the blit module and GPU is platform-dependent.
Driver Interfaces Function call These driver interfaces make calls directly to the GPU to support EGL and rendering functions.
Scene renderer Function call

The scene renderer calls the GPU driver implementation that's platform-dependent:

int (*init)(win_gpu_2_cm_iface_t *iface)
The argument for this initialization function is defined as:
typedef struct win_gpu_2_cm_iface {

    void (*finished) (void *disp_ctx,void *plane_ctx, void *region_ctx, uint32_t mask);

} win_gpu_2_cm_iface_t;
  • int (*fini)()
  • int(*invalidate)(struct win_image* image, const struct win_rect* region);

Dependencies

The GPU module is how the Screen resource manager interfaces with the GPU stack. If other shared libraries are needed to run the GPU module correctly, they must be provided in the gpu-dlls parameter so all symbols can be resolved.

Error handling

If the initialization function of the GPU module returns anything else other than zero, this is considered a failure and the module is unloaded.

Memory Usage

Memory consideration for the GPU module is outside the scope of this documentation since it's platform-dependent.

Page updated: