@@ -256,7 +256,7 @@ class IpaPiSP final : public IpaBase
256256 void applyLensShading (const AlscStatus *alscStatus,
257257 pisp_be_global_config &global);
258258 void applyDPC (const DpcStatus *dpcStatus, pisp_be_global_config &global);
259- void applyDecompand (const DecompandStatus *decompandStatus);
259+ void applyDecompand (const DecompandStatus *decompandStatus, pisp_fe_global_config &feGlobal );
260260 void applySdn (const SdnStatus *sdnStatus, pisp_be_global_config &global);
261261 void applyTdn (const TdnStatus *tdnStatus, const DeviceStatus *deviceStatus,
262262 pisp_be_global_config &global);
@@ -368,20 +368,24 @@ void IpaPiSP::platformPrepareIsp([[maybe_unused]] const PrepareParams ¶ms,
368368 {
369369 /* All Frontend config goes first, we do not want to hold the FE lock for long! */
370370 std::scoped_lock<FrontEnd> lf (*fe_);
371+ pisp_fe_global_config feGlobal;
372+
373+ fe_->GetGlobal (feGlobal);
371374
372375 if (noiseStatus)
373376 applyFocusStats (noiseStatus);
374377
375378 DecompandStatus *decompandStatus =
376379 rpiMetadata.getLocked <DecompandStatus>(" decompand.status" );
377380 if (decompandStatus)
378- applyDecompand (decompandStatus);
381+ applyDecompand (decompandStatus, feGlobal );
379382
380383 BlackLevelStatus *blackLevelStatus =
381384 rpiMetadata.getLocked <BlackLevelStatus>(" black_level.status" );
382385 if (blackLevelStatus)
383386 applyBlackLevel (blackLevelStatus, global);
384387
388+ fe_->SetGlobal (feGlobal);
385389 }
386390
387391 CacStatus *cacStatus = rpiMetadata.getLocked <CacStatus>(" cac.status" );
@@ -728,18 +732,15 @@ void IpaPiSP::applyDPC(const DpcStatus *dpcStatus, pisp_be_global_config &global
728732 be_->SetDpc (dpc);
729733}
730734
731- void IpaPiSP::applyDecompand (const DecompandStatus *decompandStatus)
735+ void IpaPiSP::applyDecompand (const DecompandStatus *decompandStatus, pisp_fe_global_config &feGlobal )
732736{
733- pisp_fe_global_config feGlobal;
734737 pisp_fe_decompand_config decompand = {};
735738
736- fe_->GetGlobal (feGlobal);
737-
738739 if (!generateDecompandLut (decompandStatus->decompandCurve , decompand.lut , PISP_FE_DECOMPAND_LUT_SIZE)) {
739740 fe_->SetDecompand (decompand);
740741 feGlobal.enables |= PISP_FE_ENABLE_DECOMPAND;
741- fe_-> SetGlobal (feGlobal);
742- }
742+ } else
743+ feGlobal. enables &= ~PISP_FE_ENABLE_DECOMPAND;
743744}
744745
745746void IpaPiSP::applySdn (const SdnStatus *sdnStatus, pisp_be_global_config &global)
0 commit comments