Skip to content

Commit

Permalink
MMAL_VC_SHM: Explicitly lock buffer when requested
Browse files Browse the repository at this point in the history
Avoids relying on the page fault locking it and
the potential deadlock in VCHI.
  • Loading branch information
6by9 authored and popcornmix committed Jun 27, 2016
1 parent 633f5e6 commit dd9636d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion interface/mmal/vc/mmal_vc_shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,14 @@ uint8_t *mmal_vc_shm_lock(uint8_t *mem, uint32_t workaround)
MMAL_VC_PAYLOAD_ELEM_T *elem = mmal_vc_payload_list_find_handle(mem);
MMAL_PARAM_UNUSED(workaround);

if (elem)
if (elem) {
mem = elem->mem;
#ifdef ENABLE_MMAL_VCSM
void *p = vcsm_lock((unsigned int)elem->handle);
if (!p)
assert(0);
#endif /* ENABLE_MMAL_VCSM */
}

return mem;
}
Expand Down

0 comments on commit dd9636d

Please sign in to comment.