Optimizing Sparklet CPU usage

All the GPU operations to be performed by Sparklet are queued in to the RGL message queue. Having a smaller queue will cause blockage inside the RGL draw functions causing CPU performance drops. Some of the configurations in the RGL library may have to be modified from default values to gain better performance especially the Jobsize and job count values in

RGL\rgl_ghs_D1Mx_obj_V2.1.0a\vlibapp\common\dhd\r_util_dhd.h.

One recommended setting is

 1/* Jobsize: Number of bytes in one job buffer */
 2#ifndef DHD_JOBSIZE
 3#define DHD_JOBSIZE      (512u)
 4#endif
 5
 6/* Jobcount: Recommended number of jobs in flight per client */
 7#ifndef DHD_JOBCOUNT
 8#define DHD_JOBCOUNT      (256) // Original value was (8u)
 9#endif
10
11/* Ringsize: Number of bytes in ringbuffer, needs to be a power of two */
12#ifndef DHD_RINGSIZE
13#define DHD_RINGSIZE      (1024u)
14#endif

Please note this is only a recommended setting and may have to be optimized on a case-by-case basis.

The required message size can be determined by using the

1     DHD_MEMORY_SIZE -(DHD_RINGSIZE_ALLOC+DHD_USER_INSTANCES*(DHD_STATESTORAGE_ALLOC+DHD_JOBCOUNT*DHD_JOBSIZE)+DHD_PC_ALLOC)
2
3     Macro in r_util_dhd.h.

Evaluate the value of macro and ensure the necessary memory is provided via the u32_rh850_video_ram_base_addr, u32_rh850_video_ram_size parameters to the sgui_rh850_mem_init function.

More details of the memory are provided in the Overview section.