Sfoglia il codice sorgente

Add a temporary fix to allow PPP to function despite rkisp1 driver bug

Kristian Vos 1 anno fa
parent
commit
36e54a5e35
1 ha cambiato i file con 10 aggiunte e 1 eliminazioni
  1. 10 1
      src/pipeline.c

+ 10 - 1
src/pipeline.c

@@ -267,7 +267,16 @@ libmegapixels_select_mode(libmegapixels_camera *camera, libmegapixels_mode *mode
 				if (subdev_fmt.format.width != cmd->width || subdev_fmt.format.height != cmd->height) {
 					log_error("Driver rejected resolution try: %dx%d, changed to %dx%d\n", cmd->width, cmd->height,
 						subdev_fmt.format.width, subdev_fmt.format.height);
-					break;
+
+					// PinePhone Pro currently has a bug where the try returns width 800, height 600, for rkisp1_isp:2, but the non-try succeeds
+					if (
+						strcmp(cmd->entity_from, "rkisp1_isp") == 0 && cmd->pad_from == 2
+					) {
+						subdev_fmt.format.width = cmd->width;
+						subdev_fmt.format.height = cmd->height;
+					} else {
+						break;
+					}
 				}
 				if (subdev_fmt.format.code != libmegapixels_format_to_media_busfmt(cmd->format)) {
 					log_error("Driver rejected pixfmt try: 0x%x\n", subdev_fmt.format.code);