[libcamera-devel,0/3] apps: cam: kms: Introduce requests tracking queue
mbox series

Message ID 20230423203931.108022-1-umang.jain@ideasonboard.com
Headers show
Series
  • apps: cam: kms: Introduce requests tracking queue
Related show

Message

Umang Jain April 23, 2023, 8:39 p.m. UTC
This series got formed while I was trying to stress test the KMSSink
with start() -> stop() -> configure() -> start() -> stop() ...
cycles (without re-allocating).

Mainly, I faced a use-after-free segmentation fault happening on stop().
It was due the fact a DRM request completes asynchronous but current
KMSSink::stop() will free that DRM request(stored in queued_ member) on
stop() - which isn't right. A queue is introduced to store requests but
mark pending requests as 'expired' on stop() (3/3)

Patch (1/3) and Patch (2/3) are drive by fixes.

Umang Jain (3):
  apps: cam: kms_sink: Do not process requests after stop()
  apps: cam: kms_sink: Drop unique_ptr<> from DRM::AtomicRequest
  apps: cam: kms_sink: Introduce a requests tracking queue

 src/apps/cam/kms_sink.cpp | 90 +++++++++++++++++++++------------------
 src/apps/cam/kms_sink.h   | 11 +++--
 2 files changed, 56 insertions(+), 45 deletions(-)