From dfa3030e767dca384f5d159c6993d5ee25b416d7 Mon Sep 17 00:00:00 2001 From: Mayuresh Kulkarni Date: Mon, 9 Apr 2012 12:21:24 +0530 Subject: video: tegra: host: rewrite nvhost_job_pin/unpin APIs - remove usage of custom interface of nvmap to patch the relocs and and pin the gathers/relocs - convert code that references nvmap_handle to nvmap_handle_ref - add logic to pin and map only unique gathers and relocs - rename nvhost_channel_gather to nvhost_job_gather, because it's used in nvhost_job code only Bug 965206 Change-Id: Iaa7fbac9e4a7b08c0a7c1e184b8dd3566e1edfe2 Signed-off-by: Mayuresh Kulkarni Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/95299 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Juha Tukkinen --- drivers/video/tegra/host/nvhost_job.h | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'drivers/video/tegra/host/nvhost_job.h') diff --git a/drivers/video/tegra/host/nvhost_job.h b/drivers/video/tegra/host/nvhost_job.h index ad9d1af60da1..48555a231412 100644 --- a/drivers/video/tegra/host/nvhost_job.h +++ b/drivers/video/tegra/host/nvhost_job.h @@ -29,6 +29,14 @@ struct nvmap_client; struct nvhost_waitchk; struct nvmap_handle; +struct nvhost_job_gather { + u32 words; + phys_addr_t mem; + u32 mem_id; + int offset; + struct nvmap_handle_ref *ref; +}; + /* * Each submit is tracked as a nvhost_job. */ @@ -50,10 +58,8 @@ struct nvhost_job { struct nvmap_client *nvmap; /* Gathers and their memory */ - struct nvmap_handle_ref *gather_mem; - struct nvhost_channel_gather *gathers; + struct nvhost_job_gather *gathers; int num_gathers; - int gather_mem_size; /* Wait checks to be processed at submit time */ struct nvhost_waitchk *waitchk; @@ -62,8 +68,8 @@ struct nvhost_job { /* Array of handles to be pinned & unpinned */ struct nvmap_pinarray_elem *pinarray; - int num_pins; - struct nvmap_handle **unpins; + int num_relocs; + struct nvmap_handle_ref **unpins; int num_unpins; /* Sync point id, number of increments and end related to the submit */ @@ -98,17 +104,6 @@ struct nvhost_job *nvhost_job_alloc(struct nvhost_channel *ch, struct nvmap_client *nvmap, int priority, int clientid); -/* - * Allocate memory for a job. Just enough memory will be allocated to - * accomodate the submit announced in submit header. Gather memory from - * oldjob will be reused, and nvhost_job_put() will be called to it. - */ -struct nvhost_job *nvhost_job_realloc(struct nvhost_job *oldjob, - struct nvhost_hwctx *hwctx, - struct nvhost_submit_hdr_ext *hdr, - struct nvmap_client *nvmap, - int priority, int clientid); - /* * Add a gather to a job. */ -- cgit v1.2.3