[PATCH/RFC,27/32] pipeline: raspberrypi: vc4: Use the CameraSensor embedded data API
diff mbox series

Message ID 20240301212121.9072-28-laurent.pinchart@ideasonboard.com
State RFC
Headers show
Series
  • libcamera: Support the upstream Unicam driver
Related show

Commit Message

Laurent Pinchart March 1, 2024, 9:21 p.m. UTC
Now that the CameraSensor class implements support for embedded data,
use the corresponding API instead of retrieving the embedded data format
from the subdev manually.

This changes requires sensor kernel drivers that implement the upstream
embedded data API based on V4L2 streams. As the API is under development
and not merged in the upstream kernel yet, this breaks compatibility
with the downstream Raspberry Pi kernel.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/libcamera/pipeline/rpi/vc4/vc4.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp
index 3c3c1b30f9e3..75dc85cf62a1 100644
--- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp
+++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp
@@ -574,9 +574,7 @@  int Vc4CameraData::platformConfigure(const RPi::RPiCameraConfiguration *rpiConfi
 	 * supports it.
 	 */
 	if (sensorMetadata_) {
-		V4L2SubdeviceFormat embeddedFormat;
-
-		sensor_->device()->getFormat(1, &embeddedFormat);
+		V4L2SubdeviceFormat embeddedFormat = sensor_->embeddedDataFormat();
 		V4L2DeviceFormat format{};
 		format.fourcc = V4L2PixelFormat(V4L2_META_FMT_SENSOR_DATA);
 		format.planes[0].size = embeddedFormat.size.width * embeddedFormat.size.height;