gpu: nvgpu: Implement common allocator and mem_desc

Introduce mem_desc, which holds all information needed for a buffer.
Implement helper functions for allocation and freeing that use this
data type.

Change-Id: I82c88595d058d4fb8c5c5fbf19d13269e48e422f
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/712699
This commit is contained in:
Terje Bergstrom
2015-02-26 14:37:43 -08:00
committed by Dan Willemsen
parent bb51cf9ec6
commit 7290a6cbd5
19 changed files with 278 additions and 701 deletions

View File

@@ -32,7 +32,7 @@ struct fifo_runlist_info_gk20a {
unsigned long *active_channels;
unsigned long *active_tsgs;
/* Each engine has its own SW and HW runlist buffer.*/
struct runlist_mem_desc mem[MAX_RUNLIST_BUFFERS];
struct mem_desc mem[MAX_RUNLIST_BUFFERS];
u32 cur_buffer;
u32 total_entries;
bool stopped;
@@ -102,9 +102,8 @@ struct fifo_gk20a {
struct fifo_runlist_info_gk20a *runlist_info;
u32 max_runlists;
struct userd_desc userd;
struct mem_desc userd;
u32 userd_entry_size;
u32 userd_total_size;
struct channel_gk20a *channel;
struct mutex ch_inuse_mutex; /* protect unused chid look up */