From: Imre Deak Date: Wed, 9 Feb 2011 07:58:13 +0000 (+0200) Subject: gpu: pvr: refactor dump_process_info X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fc7603deb86ae057d2b1dffbc30010b7759f0df;p=sgx.git gpu: pvr: refactor dump_process_info Split out from the function the part getting the process data based on the current SHX HW memory context. This functionality will be needed by an upcoming patch. Signed-off-by: Imre Deak --- diff --git a/pvr/sgxinit.c b/pvr/sgxinit.c index 0896c32..c1a15a4 100644 --- a/pvr/sgxinit.c +++ b/pvr/sgxinit.c @@ -648,24 +648,36 @@ static void dump_edm(struct PVRSRV_SGXDEV_INFO *sdev) #endif } -static void dump_process_info(struct PVRSRV_DEVICE_NODE *dev) +static struct PVRSRV_PER_PROCESS_DATA *find_cur_proc_data( + struct PVRSRV_DEVICE_NODE *dev) { struct PVRSRV_SGXDEV_INFO *dev_info = dev->pvDevice; u32 page_dir = readl(dev_info->pvRegsBaseKM + EUR_CR_BIF_DIR_LIST_BASE0); struct BM_CONTEXT *bm_ctx; struct RESMAN_CONTEXT *res_ctx = NULL; + struct PVRSRV_PER_PROCESS_DATA *proc_data = NULL; bm_ctx = bm_find_context(dev->sDevMemoryInfo.pBMContext, page_dir); if (bm_ctx) res_ctx = pvr_get_resman_ctx(bm_ctx); - if (res_ctx) { + if (res_ctx) + proc_data = pvr_get_proc_by_ctx(res_ctx); + + return proc_data; +} + +static void dump_process_info(struct PVRSRV_DEVICE_NODE *dev) +{ + struct PVRSRV_PER_PROCESS_DATA *proc; + + proc = find_cur_proc_data(dev); + + if (proc) { struct task_struct *tsk; - struct PVRSRV_PER_PROCESS_DATA *proc; int pid; - proc = pvr_get_proc_by_ctx(res_ctx); pid = proc->ui32PID; rcu_read_lock(); tsk = pid_task(find_vpid(pid), PIDTYPE_PID);