From 23c7903eff6ee1ab184dfcc62c054de1557e5b1d Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Thu, 26 Oct 2017 08:29:56 -0700 Subject: gpu: nvgpu: move submit path to linux Nvgpu submit path has a lot of dependency on Linux framework e.g. use of copy_from_user, use of structures defined in uapi/nvgpu headers, dma_buf_* calls for trace support etc Hence to keep common code independent of Linux code, move submit path to Linux directory Move below APIs to common/linux/channel.c trace_write_pushbuffer() trace_write_pushbuffer_range() gk20a_submit_prepare_syncs() gk20a_submit_append_priv_cmdbuf() gk20a_submit_append_gpfifo() gk20a_submit_channel_gpfifo() Move below APIs to common/linux/ce2.c gk20a_ce_execute_ops() Define gk20a_ce_execute_ops() in common/linux/ce2.c, and declare it in gk20a/ce2_gk20a.h since it is needed in common/mm code too Each OS needs to implement this API separately gk20a_channel_alloc_gpfifo() use sizeof(nvgpu_gpfifo) to get size of one gpfifo entry, but structure nvgpu_gpfifo is linux specific Define new nvgpu_get_gpfifo_entry_size() in linux specific code and use it in gk20a_channel_alloc_gpfifo() to get gpfifo entry size Each OS needs to implement this API separately Export some APIs from gk20a/ce2_gk20a.h and gk20a/channel_gk20a.h that are needed in linux code Jira NVGPU-259 Jira NVGPU-313 Change-Id: I360c6cb8ce4494b1e50c66af334a2a379f0d2dc4 Signed-off-by: Deepak Nibade Reviewed-on: https://git-master.nvidia.com/r/1586277 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/channel_gk20a.h | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h index 4b1cb351..cdf75a9a 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h @@ -24,6 +24,9 @@ #ifndef CHANNEL_GK20A_H #define CHANNEL_GK20A_H +/* TODO: To be removed when work_struct update_fn_work is moved out of common code */ +#include + #include #include @@ -374,16 +377,6 @@ struct channel_gk20a *gk20a_open_new_channel_with_cb(struct gk20a *g, int runlist_id, bool is_privileged_channel); -int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, - struct nvgpu_gpfifo *gpfifo, - struct nvgpu_submit_gpfifo_args *args, - u32 num_entries, - u32 flags, - struct nvgpu_fence *fence, - struct gk20a_fence **fence_out, - bool force_need_sync_fence, - struct fifo_profile_gk20a *profile); - int gk20a_channel_alloc_gpfifo(struct channel_gk20a *c, unsigned int num_entries, unsigned int num_inflight_jobs, @@ -408,4 +401,20 @@ int gk20a_channel_set_runlist_interleave(struct channel_gk20a *ch, void gk20a_channel_event_id_post_event(struct channel_gk20a *ch, u32 event_id); +int channel_gk20a_alloc_job(struct channel_gk20a *c, + struct channel_gk20a_job **job_out); +void channel_gk20a_free_job(struct channel_gk20a *c, + struct channel_gk20a_job *job); +u32 nvgpu_get_gp_free_count(struct channel_gk20a *c); +u32 nvgpu_gp_free_count(struct channel_gk20a *c); +int gk20a_channel_add_job(struct channel_gk20a *c, + struct channel_gk20a_job *job, + bool skip_buffer_refcounting); +void free_priv_cmdbuf(struct channel_gk20a *c, + struct priv_cmd_entry *e); +void gk20a_channel_clean_up_jobs(struct channel_gk20a *c, + bool clean_all); + +u32 nvgpu_get_gpfifo_entry_size(void); + #endif /* CHANNEL_GK20A_H */ -- cgit v1.2.2