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>
62 lines
1.7 KiB
C
62 lines
1.7 KiB
C
/*
|
|
*
|
|
* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 and
|
|
* only version 2 as published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
*/
|
|
#ifndef _FMEM_H_
|
|
#define _FMEM_H_
|
|
|
|
#include <linux/vmalloc.h>
|
|
|
|
struct fmem_platform_data {
|
|
unsigned long phys;
|
|
unsigned long size;
|
|
unsigned long reserved_size_low;
|
|
unsigned long reserved_size_high;
|
|
};
|
|
|
|
struct fmem_data {
|
|
unsigned long phys;
|
|
void *virt;
|
|
struct vm_struct *area;
|
|
unsigned long size;
|
|
unsigned long reserved_size_low;
|
|
unsigned long reserved_size_high;
|
|
};
|
|
|
|
enum fmem_state {
|
|
FMEM_UNINITIALIZED = 0,
|
|
FMEM_C_STATE,
|
|
FMEM_T_STATE,
|
|
FMEM_O_STATE,
|
|
};
|
|
|
|
#ifdef CONFIG_QCACHE
|
|
struct fmem_data *fmem_get_info(void);
|
|
int fmem_set_state(enum fmem_state);
|
|
void lock_fmem_state(void);
|
|
void unlock_fmem_state(void);
|
|
void *fmem_map_virtual_area(int cacheability);
|
|
void fmem_unmap_virtual_area(void);
|
|
#else
|
|
static inline struct fmem_data *fmem_get_info(void) { return NULL; }
|
|
static inline int fmem_set_state(enum fmem_state f) { return -ENODEV; }
|
|
static inline void lock_fmem_state(void) { return; }
|
|
static inline void unlock_fmem_state(void) { return; }
|
|
static inline void *fmem_map_virtual_area(int cacheability) { return NULL; }
|
|
static inline void fmem_unmap_virtual_area(void) { return; }
|
|
#endif
|
|
|
|
int request_fmem_c_region(void *unused);
|
|
int release_fmem_c_region(void *unused);
|
|
#endif
|