gpu: ion: Move MFC heap to different address
Video hardware has the following requirements for ION heaps: 1. MM heap must be at a higher address than FW heap. 2. MFC heap must at a higher address than FW 3. MM heap must be adjacent to FW heap. (There cannot be another heap between FW and MM heap) 4. MM and MFC heap cannot be more than 256MB away from the base address of the FW heap. MM heap is configured as a reusable heap (FMEM heap) and FMEM is carved out at a much higher address than the other heaps breaking the above requirements. To support the above requirements the MFC heap together with the FW heap must be carved out at the same location as MM heap. Change-Id: Ie0acb4b267d4307190ea3cd9ff23c710ffa1a538 Signed-off-by: Olav Haugan <ohaugan@codeaurora.org> [sboyd: drop fmem changes] Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
This commit is contained in:
committed by
Stephen Boyd
parent
b0688ac87f
commit
e72f57b2cd
@@ -93,7 +93,7 @@ static void allocate_co_memory(struct ion_platform_heap *heap,
|
||||
const struct fmem_data *fmem_info =
|
||||
fmem_get_info();
|
||||
heap->base = fmem_info->phys -
|
||||
fmem_info->reserved_size;
|
||||
fmem_info->reserved_size_low;
|
||||
cp_data->virt_addr = fmem_info->virt;
|
||||
pr_info("ION heap %s using FMEM\n",
|
||||
shared_heap->name);
|
||||
@@ -161,6 +161,10 @@ static void msm_ion_allocate(struct ion_platform_heap *heap)
|
||||
heap->base = fmem_info->phys;
|
||||
data->virt_addr = fmem_info->virt;
|
||||
pr_info("ION heap %s using FMEM\n", heap->name);
|
||||
} else if (data->mem_is_fmem) {
|
||||
const struct fmem_data *fmem_info =
|
||||
fmem_get_info();
|
||||
heap->base = fmem_info->phys + fmem_info->size;
|
||||
}
|
||||
align = data->align;
|
||||
break;
|
||||
|
||||
@@ -159,6 +159,8 @@ struct ion_platform_heap {
|
||||
* of this heap in the case of a shared heap.
|
||||
* @reusable Flag indicating whether this heap is reusable of not.
|
||||
* (see FMEM)
|
||||
* @mem_is_fmem Flag indicating whether this memory is coming from fmem
|
||||
* or not.
|
||||
* @virt_addr: Virtual address used when using fmem.
|
||||
* @request_region: function to be called when the number of allocations
|
||||
* goes from 0 -> 1
|
||||
@@ -173,6 +175,7 @@ struct ion_cp_heap_pdata {
|
||||
ion_phys_addr_t secure_base; /* Base addr used when heap is shared */
|
||||
size_t secure_size; /* Size used for securing heap when heap is shared*/
|
||||
int reusable;
|
||||
int mem_is_fmem;
|
||||
ion_virt_addr_t *virt_addr;
|
||||
int (*request_region)(void *);
|
||||
int (*release_region)(void *);
|
||||
@@ -183,6 +186,8 @@ struct ion_cp_heap_pdata {
|
||||
* struct ion_co_heap_pdata - defines a carveout heap in the given platform
|
||||
* @adjacent_mem_id: Id of heap that this heap must be adjacent to.
|
||||
* @align: Alignment requirement for the memory
|
||||
* @mem_is_fmem Flag indicating whether this memory is coming from fmem
|
||||
* or not.
|
||||
* @request_region: function to be called when the number of allocations
|
||||
* goes from 0 -> 1
|
||||
* @release_region: function to be called when the number of allocations
|
||||
@@ -193,6 +198,7 @@ struct ion_cp_heap_pdata {
|
||||
struct ion_co_heap_pdata {
|
||||
int adjacent_mem_id;
|
||||
unsigned int align;
|
||||
int mem_is_fmem;
|
||||
int (*request_region)(void *);
|
||||
int (*release_region)(void *);
|
||||
void *(*setup_region)(void);
|
||||
|
||||
Reference in New Issue
Block a user