Closed dougnazar closed 1 year ago
I suppose the heap mask does not change, so caching this would not cause problems?
I don't believe so. The CMA regions are usually specified in the device tree and although I didn't look to see if there was support for dynamically modifying the CMAs, I did check the ION code and all it does on startup is loop through the existing CMAs and add them as ION DMA heaps.
I suppose the other option is to push the detection up to when the allocator is created and override the passed in mask there. That'll limit it to one query per pipeline I think, but anybody playing games with +/- memory zones should probably be stopping all programs that might be using them first.
I noticed since on my setup I have 2 CMAs, one dedicated for GPU and was getting errors since it was trying to allocate from the smaller general CMA first.
This could be called a dozen times or so per file played and should be static after booting.