Due to a limitation in how the video hardware is able to access memory, fmem needs to be able to allocate a physically contiguous block of memory that can be split into two pieces. One piece will be managed by fmem while the other piece (reserved) will not be handled by fmem. The hardware limitation requires the reserved part to be at a lower address than the other piece managed by fmem. Add a new parameter to fmem that allows platform data to specify the size of the piece that should not be managed by fmem. Change-Id: I910680ca72233de9cef91ac3262a078a36f1b1fd Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
60 lines
1.6 KiB
C
60 lines
1.6 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;
|
|
};
|
|
|
|
struct fmem_data {
|
|
unsigned long phys;
|
|
void *virt;
|
|
struct vm_struct *area;
|
|
unsigned long size;
|
|
unsigned long reserved_size;
|
|
};
|
|
|
|
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
|