Repository navigation
Conversation
deep0294
force-pushed
the
privacy-shutter-fix
branch
15 times, most recently
from
October 13, 2026 08:28
c632bab to
82491df
Compare
Strengthen privacy shutter switchover robustness and resolve edge cases across threading, buffer ownership, and lifecycle. Tracked-On: #JSWBALINUX-181 Change-Id: I9665191d8a13bb5d8258a371fb74bc02ce516f69 Signed-off-by: Amarnath Kumar, Deepak <deepak.amarnath.kumar@intel.com>
deep0294
force-pushed
the
privacy-shutter-fix
branch
from
October 13, 2026 09:07
82491df to
85561c7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Technical Summary & Overview
This change comprehensively hardens the Intel Linux Camera HAL (
libcamhal) privacy shutter subsystem on IPU7/IPU8 platforms (#JSWBALINUX-181). It resolves critical race conditions, threading deadlocks, state-machine synchronization failures, buffer ownership leaks, DMA memory corruption, and visual artifacts (freezes, tearing, ghosting) during rapid physical privacy shutter open/close toggles and cold launch with the shutter closed.Key Features & Architectural Enhancements
1. Robust State Machine & Asynchronous Lifecycle Synchronization (
CameraDevice)class IsysTeardownThread : public Threadwithstd::thread mIsysTeardownThread.joinIsysTeardown()guarantees that sub-unit stops and hardware node destruction complete unconditionally without being aborted mid-execution during rapid shutter bouncing.switchToNormal(),mBackupProducer->stop()and listener unregistration execute first, halting dummy frame generation immediately to prevent stale dummy frame backlog from flooding client applications.CameraDevice::start(); if closed, starts directly into backup streaming without initializing live ISYS/PSYS silicon, saving platform power and eliminating un-shuttering crashes.CaptureUnit::reconfigure()fails, preventing pipeline freezes.dqbuf()Lifecycle: Synchronizesdqbuf()state inspection undermDeviceLockafterwaitFrame()to prevent deadlocks withstop().2. DMA Lifecycle & Hardware Buffer Re-entrancy Protection (
CaptureUnit,DeviceBase,CsiMetaDevice)CaptureUnit::reconfigure()verifies if the unit is inCAPTURE_STARTand executesstop()anddestroyDevices()before configuring new parameters, avoidingINVALID_OPERATION(-38) state violations.DeviceBase::addPendingBuffer()checks against bothmPendingBuffersandmBuffersInDevicebefore queuing to the kernel V4L2 video ring, eliminating kernelVIDIOC_QBUF-EINVALduplicate enqueues.BufferConsumerlist operations withmConsumerLockacross buffer queues.3. PSYS Pipeline Lifecycle & TNR State Cleansing (
PSysDevice,CBStage,PipeLine,PipeManager)memsetzeroing of intermediate pipeline and node2self frame buffers inCBStage::allocateFrameBuffers()to prevent Temporal Noise Reduction (TNR) filters from blending stale pre-shutter frames with fresh sensor data.suspendPolling()/resumePolling()inPSysDeviceand lifecycle stops inPipeLineandPipeManagerto avoid servicing dangling tasks during transitions.4. Deterministic Buffer Handoff & Monotonic Sequencing (
CameraStream,RequestThread,ProcessingUnit,FileSource)CameraStream::redirectBufferProducer()transfers active in-flight buffers between producers with sequence epoch reset (setSettingSequence(-1)), and removes buffers frommBufferInProcessingprior to listener dispatch to prevent re-entrancy races.ubuffer->sequencedelivery inCameraStream::onBufferAvailable()across transitions from dummy to live streaming, avoiding sequence drops (RequestThread::reserveEffectSeqRange()reserves the exact sequence range consumed by carried-over buffers so initial 3AeffectSeqassignments align with incoming live sensor frames without queue collision.FileSource::produce()synchronizessetSettingSequence()withmSequence, ensuring monotonic timestamps and sequencing across all dummy frames.AiqResultStorage::resetAiqResults()to invalidate cached 3A results and prevent stale exposure/gain application across stream restarts.5. Platform & Sensor Configuration (
PlatformData,CameraSensorsParser)privacyShutterActiveLowJSON parser and schema support inPlatformDatato accurately model hardware GPIO lid switches and electrical buttons across different OEM designs.Usage & Verification
Test Command (GStreamer)
Verification Results
Tracked-On: #JSWBALINUX-181
Signed-off-by: Amarnath Kumar, Deepak deepak.amarnath.kumar@intel.com