diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
index 50eaa6a4..56a406c1 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
@@ -474,10 +474,37 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate()
 		return Invalid;
 	}
 
-	/* Select the sensor format. */
-	Size maxSize;
+	/* Get the ISP resolution limits */
+	V4L2Subdevice::Formats ispFormats = data_->isp_->formats(0);
+	if (ispFormats.empty()) {
+		LOG(RkISP1, Error) << "Unable to fetch ISP formats.";
+		return Invalid;
+	}
+	/*
+	 * The maximum resolution is identical for all media bus codes on
+	 * the RkISP1 isp entity. Therefore take the first available resolution.
+	 */
+	Size ispMaximum = ispFormats.begin()->second[0].max;
+
+	/*
+	 * Select the sensor format, use either the best fit to the configured
+	 * format or a specific sensor format, when getFormat would choose a
+	 * resolution that surpasses the ISP maximum.
+	 */
+	Size maxSensorSize;
+	for (const Size &size : sensor->sizes()) {
+		if (size.width > ispMaximum.width ||
+		    size.height > ispMaximum.height)
+			continue;
+		maxSensorSize = std::max(maxSensorSize, size);
+	}
+	Size maxConfigSize;
 	for (const StreamConfiguration &cfg : config_)
-		maxSize = std::max(maxSize, cfg.size);
+		maxConfigSize = std::max(maxConfigSize, cfg.size);
+
+	if (maxConfigSize.height <= maxSensorSize.height &&
+	    maxConfigSize.width <= maxSensorSize.width)
+		maxSensorSize = maxConfigSize;
 
 	sensorFormat_ = sensor->getFormat({ MEDIA_BUS_FMT_SBGGR12_1X12,
 					    MEDIA_BUS_FMT_SGBRG12_1X12,
@@ -491,7 +518,7 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate()
 					    MEDIA_BUS_FMT_SGBRG8_1X8,
 					    MEDIA_BUS_FMT_SGRBG8_1X8,
 					    MEDIA_BUS_FMT_SRGGB8_1X8 },
-					  maxSize);
+					  maxSensorSize);
 	if (sensorFormat_.size.isNull())
 		sensorFormat_.size = sensor->resolution();
 
