@@ -84,7 +84,8 @@
extern DSP_STATUS STRM_AllocateBuffer(struct STRM_OBJECT *hStrm,
u32 uSize,
OUT u8 **apBuffer,
- u32 uNumBufs);
+ u32 uNumBufs,
+ struct PROCESS_CONTEXT *pr_ctxt);
/*
* ======== STRM_Close ========
@@ -1493,7 +1493,7 @@ u32 STRMWRAP_AllocateBuffer(union Trapped_Args *args, void *pr_ctxt)
status = STRM_AllocateBuffer(args->ARGS_STRM_ALLOCATEBUFFER.hStream,
args->ARGS_STRM_ALLOCATEBUFFER.uSize,
- apBuffer, uNumBufs);
+ apBuffer, uNumBufs, pr_ctxt);
cp_to_usr(args->ARGS_STRM_ALLOCATEBUFFER.apBuffer, apBuffer, status,
uNumBufs);
if (apBuffer)
@@ -154,18 +154,15 @@ static void DeleteStrmMgr(struct STRM_MGR *hStrmMgr);
* Allocates buffers for a stream.
*/
DSP_STATUS STRM_AllocateBuffer(struct STRM_OBJECT *hStrm, u32 uSize,
- OUT u8 **apBuffer, u32 uNumBufs)
+ OUT u8 **apBuffer, u32 uNumBufs,
+ struct PROCESS_CONTEXT *pr_ctxt)
{
DSP_STATUS status = DSP_SOK;
u32 uAllocated = 0;
u32 i;
- #ifndef RES_CLEANUP_DISABLE
- DSP_STATUS res_status = DSP_SOK;
- u32 hProcess;
- HANDLE pCtxt = NULL;
- HANDLE hDrvObject;
+#ifndef RES_CLEANUP_DISABLE
HANDLE hSTRMRes;
- #endif
+#endif
DBC_Require(cRefs > 0);
DBC_Require(apBuffer != NULL);
@@ -203,20 +200,9 @@ DSP_STATUS STRM_AllocateBuffer(struct STRM_OBJECT *hStrm, u32 uSize,
if (DSP_FAILED(status))
goto func_end;
- /* Return TGID instead of process handle */
- hProcess = current->tgid;
-
- res_status = CFG_GetObject((u32 *)&hDrvObject, REG_DRV_OBJECT);
- if (DSP_FAILED(res_status))
- goto func_end;
-
- DRV_GetProcContext(hProcess, (struct DRV_OBJECT *)hDrvObject,
- &pCtxt, NULL, 0);
- if (pCtxt != NULL) {
- if (DRV_GetSTRMResElement(hStrm, &hSTRMRes, pCtxt) !=
- DSP_ENOTFOUND) {
- DRV_ProcUpdateSTRMRes(uNumBufs, hSTRMRes, pCtxt);
- }
+ if (DRV_GetSTRMResElement(hStrm, &hSTRMRes, pr_ctxt) !=
+ DSP_ENOTFOUND) {
+ DRV_ProcUpdateSTRMRes(uNumBufs, hSTRMRes, pr_ctxt);
}
#endif
func_end:
Signed-off-by: Ameya Palande <ameya.palande@nokia.com> --- arch/arm/plat-omap/include/dspbridge/strm.h | 3 +- drivers/dsp/bridge/pmgr/wcd.c | 2 +- drivers/dsp/bridge/rmgr/strm.c | 28 ++++++-------------------- 3 files changed, 10 insertions(+), 23 deletions(-)