media: rockchip: vicap fixes crop sync error

while two camera link to a device tree, if the link relationship is switched from one sensor to another,
there may be error messages in crop information

Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I6b6aa3efcf8f862b5b1b6e41fb2b4c2fcead2282
This commit is contained in:
Zefa Chen
2023-08-11 10:57:25 +08:00
committed by Tao Huang
parent e4bbd1b7a1
commit 8bd1123ed7

View File

@@ -5356,6 +5356,7 @@ static void rkcif_sync_crop_info(struct rkcif_stream *stream)
stream->crop_mask |= CROP_SRC_SENSOR_MASK;
dev->terminal_sensor.selection = input_sel;
} else {
stream->crop_mask &= ~CROP_SRC_SENSOR_MASK;
dev->terminal_sensor.selection.r = dev->terminal_sensor.raw_rect;
}
}
@@ -5376,8 +5377,10 @@ static void rkcif_sync_crop_info(struct rkcif_stream *stream)
stream->crop[CROP_SRC_ACT].top = stream->crop[CROP_SRC_USR].top +
stream->crop[CROP_SRC_SENSOR].top;
}
} else {
} else if (stream->crop_mask & CROP_SRC_SENSOR_MASK) {
stream->crop[CROP_SRC_ACT] = stream->crop[CROP_SRC_SENSOR];
} else {
stream->crop[CROP_SRC_ACT] = dev->terminal_sensor.raw_rect;
}
}