diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index 42c9caa..7aace71 100644
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
@@ -400,6 +400,17 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()
 	if (config_.empty())
 		return Invalid;
 
+	/*
+	 * Configure the H/V flip controls based on the sensor rotation. We do
+	 * this here so that the sensor has the correct Bayer format that will
+	 * get advertised in the configuration of any raw streams.
+	 */
+	ControlList ctrls(data_->unicam_[Unicam::Image].dev()->controls());
+	int32_t rotation = data_->sensor_->properties().get(properties::Rotation);
+	ctrls.set(V4L2_CID_HFLIP, static_cast<int32_t>(!!rotation));
+	ctrls.set(V4L2_CID_VFLIP, static_cast<int32_t>(!!rotation));
+	data_->unicam_[Unicam::Image].dev()->setControls(&ctrls);
+
 	unsigned int rawCount = 0, outCount = 0, count = 0, maxIndex = 0;
 	std::pair<int, Size> outSize[2];
 	Size maxSize;
@@ -1164,13 +1175,6 @@ int RPiCameraData::configureIPA()
 					      { V4L2_CID_EXPOSURE, result.data[1] } });
 			sensorMetadata_ = result.data[2];
 		}
-
-		/* Configure the H/V flip controls based on the sensor rotation. */
-		ControlList ctrls(unicam_[Unicam::Image].dev()->controls());
-		int32_t rotation = sensor_->properties().get(properties::Rotation);
-		ctrls.set(V4L2_CID_HFLIP, static_cast<int32_t>(!!rotation));
-		ctrls.set(V4L2_CID_VFLIP, static_cast<int32_t>(!!rotation));
-		unicam_[Unicam::Image].dev()->setControls(&ctrls);
 	}
 
 	if (result.operation & RPI_IPA_CONFIG_SENSOR) {
