diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp
index 771128fc3d4c..998e3dbfeaba 100644
--- a/src/ipa/rkisp1/algorithms/agc.cpp
+++ b/src/ipa/rkisp1/algorithms/agc.cpp
@@ -134,6 +134,18 @@ Agc::Agc()
 	supportsRaw_ = true;
 }
 
+const std::set<ipa::AlgorithmDependency> &Agc::dependencies() const
+{
+	static const std::set<AlgorithmDependency> dependencies = {
+		{
+			.target = "Compress",
+			.step = AlgorithmStep::Configure,
+			.type = AlgorithmDependency::Before,
+		}
+	};
+	return dependencies;
+}
+
 /**
  * \brief Initialise the AGC algorithm from tuning files
  * \param[in] context The shared IPA context
@@ -173,22 +185,19 @@ int Agc::init(IPAContext &context, const ValueNode &tuningData)
  */
 int Agc::configure(IPAContext &context, const IPACameraSensorInfo &configInfo)
 {
-	int ret = agc_.configure(context.configuration.agc, context.activeState.agc, {
-		.sensorInfo = context.sensorInfo,
-		.sensorControls = context.sensorControls,
-		.ctrlMap = context.ctrlMap,
-		.autoAllowed = !context.configuration.raw,
-		/*
-		 * \todo The Compress algo must come after Agc in the tuning
-		 * file to pick up the digital gain in prepare(). But as it is
-		 * after Agc we can't query
-		 * context.configuration.compress.supported here as the Compress
-		 * algo is not configured yet. Therefore enable digital gain
-		 * unconditionally for now. It won't effectively be enabled if
-		 * the tuning file doesn't contain a maxDigitalGain > 1.
-		 */
-		.maxDigitalGain = kAgcMaxDigitalGain
-	});
+	int ret = agc_.configure(
+		context.configuration.agc,
+		context.activeState.agc,
+		{
+			.sensorInfo = context.sensorInfo,
+			.sensorControls = context.sensorControls,
+			.ctrlMap = context.ctrlMap,
+			.autoAllowed = !context.configuration.raw,
+			.maxDigitalGain = context.configuration.compress.supported
+						  ? kAgcMaxDigitalGain
+						  : 1.0,
+		});
+
 	if (ret)
 		return ret;
 
diff --git a/src/ipa/rkisp1/algorithms/agc.h b/src/ipa/rkisp1/algorithms/agc.h
index b8d59352e70d..9cee84bf6153 100644
--- a/src/ipa/rkisp1/algorithms/agc.h
+++ b/src/ipa/rkisp1/algorithms/agc.h
@@ -41,6 +41,8 @@ public:
 		     const rkisp1_stat_buffer *stats,
 		     ControlList &metadata) override;
 
+	virtual const std::set<AlgorithmDependency> &dependencies() const override;
+
 private:
 	int parseMeteringModes(IPAContext &context, const ValueNode &tuningData);
 	uint8_t computeHistogramPredivider(const Size &size,
diff --git a/src/ipa/rkisp1/algorithms/compress.cpp b/src/ipa/rkisp1/algorithms/compress.cpp
index 2afa449608b7..16077c29b21a 100644
--- a/src/ipa/rkisp1/algorithms/compress.cpp
+++ b/src/ipa/rkisp1/algorithms/compress.cpp
@@ -44,6 +44,23 @@ LOG_DEFINE_CATEGORY(RkISP1Compress)
 constexpr static int kRkISP1CompressInBits = 20;
 constexpr static int kRkISP1CompressOutBits = 12;
 
+const std::set<ipa::AlgorithmDependency> &Compress::dependencies() const
+{
+	static const std::set<AlgorithmDependency> dependencies = {
+		{
+			.target = "Agc",
+			.step = AlgorithmStep::Prepare,
+			.type = AlgorithmDependency::Before,
+		},
+		{
+			.target = "Agc",
+			.step = AlgorithmStep::Process,
+			.type = AlgorithmDependency::Before,
+		}
+	};
+	return dependencies;
+}
+
 /**
  * \copydoc libcamera::ipa::Algorithm::configure
  */
diff --git a/src/ipa/rkisp1/algorithms/compress.h b/src/ipa/rkisp1/algorithms/compress.h
index 87797b8ebcc5..31d516a31685 100644
--- a/src/ipa/rkisp1/algorithms/compress.h
+++ b/src/ipa/rkisp1/algorithms/compress.h
@@ -24,6 +24,8 @@ public:
 	void prepare(IPAContext &context, const uint32_t frame,
 		     IPAFrameContext &frameContext,
 		     RkISP1Params *params) override;
+
+	const std::set<ipa::AlgorithmDependency> &dependencies() const override;
 };
 
 } /* namespace ipa::rkisp1::algorithms */
