forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/media/platform/vsp1/vsp1_uds.c
....@@ -257,6 +257,7 @@
257257
258258 static void uds_configure_stream(struct vsp1_entity *entity,
259259 struct vsp1_pipeline *pipe,
260
+ struct vsp1_dl_list *dl,
260261 struct vsp1_dl_body *dlb)
261262 {
262263 struct vsp1_uds *uds = to_uds(&entity->subdev);
....@@ -314,13 +315,13 @@
314315 output = vsp1_entity_get_pad_format(&uds->entity, uds->entity.config,
315316 UDS_PAD_SOURCE);
316317
317
- /* Input size clipping */
318
+ /* Input size clipping. */
318319 vsp1_uds_write(uds, dlb, VI6_UDS_HSZCLIP, VI6_UDS_HSZCLIP_HCEN |
319320 (0 << VI6_UDS_HSZCLIP_HCL_OFST_SHIFT) |
320321 (partition->uds_sink.width
321322 << VI6_UDS_HSZCLIP_HCL_SIZE_SHIFT));
322323
323
- /* Output size clipping */
324
+ /* Output size clipping. */
324325 vsp1_uds_write(uds, dlb, VI6_UDS_CLIP_SIZE,
325326 (partition->uds_source.width
326327 << VI6_UDS_CLIP_SIZE_HSIZE_SHIFT) |
....@@ -342,6 +343,14 @@
342343 UDS_PAD_SOURCE);
343344 hscale = output->width / input->width;
344345
346
+ /*
347
+ * The maximum width of the UDS is 304 pixels. These are input pixels
348
+ * in the event of up-scaling, and output pixels in the event of
349
+ * downscaling.
350
+ *
351
+ * To support overlapping partition windows we clamp at units of 256 and
352
+ * the remaining pixels are reserved.
353
+ */
345354 if (hscale <= 2)
346355 return 256;
347356 else if (hscale <= 4)
....@@ -366,7 +375,7 @@
366375 const struct v4l2_mbus_framefmt *output;
367376 const struct v4l2_mbus_framefmt *input;
368377
369
- /* Initialise the partition state */
378
+ /* Initialise the partition state. */
370379 partition->uds_sink = *window;
371380 partition->uds_source = *window;
372381