diff options
| author | Kirill Artamonov <kartamonov@nvidia.com> | 2021-06-14 19:47:30 -0400 |
|---|---|---|
| committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2021-06-21 04:54:58 -0400 |
| commit | 9efa7c771b53d6e0e51336cb1cda5e1aed579008 (patch) | |
| tree | da106538fde870e91c85a8d198b43aa0d9cc3b36 /include | |
| parent | 582806934788414445291cb103f8560bfd1618d6 (diff) | |
include: soc: tegra: add ISP memoryinfo ring buffers
Use dedicated ringbuffers to pass ISP iova pointers between
KMD and RCE.
CAMASIL-7476
bug 2768992
bug 3231670
bug 200688288
bug 200690078
CAMASIL-7472
CAMASIL-7474
CAMASIL-7475
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2487426
(cherry picked from commit 8c18aedcb887dd094b60ac5a0de0cf0de7d7af51)
include: soc: tegra: add VI memoryinfo ring buffer struct
Use dedicated ringbuffer to pass VI iova pointers between KMD
and RCE.
CAMASIL-7465
bug 2768992
bug 3231670
bug 200688288
bug 200690078
CAMASIL-7460
CAMASIL-7477
CAMASIL-4619
Signed-off-by: Kirill Artamonov <kartamonov@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2475649
(cherry picked from commit 896af71c8d84b2ee77b0df542b96724d117b35bf)
Signed-off-by: Kirill Artamonov <kartamonov@nvidia.com>
Change-Id: I70e3052961ea7396f632468c2e1aaf65c5caa5c6
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2544991
Reviewed-by: Igor Mitsyanko <imitsyanko@nvidia.com>
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
Reviewed-by: Pekka Pessi <ppessi@nvidia.com>
Reviewed-by: Mika Liljeberg <mliljeberg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: Igor Mitsyanko <imitsyanko@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'include')
| -rw-r--r-- | include/soc/tegra/camrtc-capture.h | 108 |
1 files changed, 106 insertions, 2 deletions
diff --git a/include/soc/tegra/camrtc-capture.h b/include/soc/tegra/camrtc-capture.h index 9d9d397ce..b56cf57af 100644 --- a/include/soc/tegra/camrtc-capture.h +++ b/include/soc/tegra/camrtc-capture.h | |||
| @@ -189,9 +189,22 @@ struct capture_channel_config { | |||
| 189 | uint32_t channel_id; /* rtcpu internal - set to zero */ | 189 | uint32_t channel_id; /* rtcpu internal - set to zero */ |
| 190 | uint64_t vi_channel_mask; | 190 | uint64_t vi_channel_mask; |
| 191 | iova_t requests; | 191 | iova_t requests; |
| 192 | |||
| 193 | /** | ||
| 194 | * Base address of a memory mapped ring buffer containing capture requests buffer | ||
| 195 | * information. | ||
| 196 | * The size of the buffer is queue_depth * request_memoryinfo_size | ||
| 197 | */ | ||
| 198 | iova_t requests_memoryinfo; | ||
| 199 | |||
| 192 | uint32_t queue_depth; | 200 | uint32_t queue_depth; |
| 193 | uint32_t request_size; | 201 | uint32_t request_size; |
| 194 | 202 | ||
| 203 | /** Size of the memoryinfo buffer reserved for each capture request. */ | ||
| 204 | uint32_t request_memoryinfo_size; | ||
| 205 | /** Reserved */ | ||
| 206 | uint32_t reserved32; | ||
| 207 | |||
| 195 | uint8_t slvsec_stream_main; | 208 | uint8_t slvsec_stream_main; |
| 196 | uint8_t slvsec_stream_sub; | 209 | uint8_t slvsec_stream_sub; |
| 197 | uint16_t reserved1; | 210 | uint16_t reserved1; |
| @@ -353,6 +366,31 @@ struct vi_channel_config { | |||
| 353 | 366 | ||
| 354 | } __CAPTURE_IVC_ALIGN; | 367 | } __CAPTURE_IVC_ALIGN; |
| 355 | 368 | ||
| 369 | /** | ||
| 370 | * @brief Memory surface specs passed from KMD to RCE | ||
| 371 | */ | ||
| 372 | struct memoryinfo_surface { | ||
| 373 | /** Surface iova address */ | ||
| 374 | uint64_t base_address; | ||
| 375 | /** Surface size */ | ||
| 376 | uint64_t size; | ||
| 377 | }; | ||
| 378 | |||
| 379 | /** | ||
| 380 | * @brief VI capture descriptor memory information | ||
| 381 | * | ||
| 382 | * VI capture descriptor memory information shared between | ||
| 383 | * KMD and RCE only. This information cannot be part of | ||
| 384 | * capture descriptor since descriptor is shared with usermode | ||
| 385 | * application. | ||
| 386 | */ | ||
| 387 | struct capture_descriptor_memoryinfo { | ||
| 388 | struct memoryinfo_surface surface[VI_NUM_ATOMP_SURFACES]; | ||
| 389 | struct memoryinfo_surface engine_status; | ||
| 390 | /** pad for alignment */ | ||
| 391 | uint32_t reserved32[12]; | ||
| 392 | } __CAPTURE_DESCRIPTOR_ALIGN; | ||
| 393 | |||
| 356 | struct engine_status_surface { | 394 | struct engine_status_surface { |
| 357 | uint32_t offset; | 395 | uint32_t offset; |
| 358 | uint32_t offset_hi; | 396 | uint32_t offset_hi; |
| @@ -1072,6 +1110,27 @@ struct capture_channel_isp_config { | |||
| 1072 | struct syncpoint_info progress_sp; | 1110 | struct syncpoint_info progress_sp; |
| 1073 | struct syncpoint_info stats_progress_sp; | 1111 | struct syncpoint_info stats_progress_sp; |
| 1074 | 1112 | ||
| 1113 | /** | ||
| 1114 | * Base address of a memory mapped ring buffer containing ISP requests | ||
| 1115 | * buffer information. | ||
| 1116 | * The size of the buffer is queue_depth * request_memoryinfo_size | ||
| 1117 | */ | ||
| 1118 | iova_t requests_memoryinfo; | ||
| 1119 | |||
| 1120 | /** | ||
| 1121 | * Base address of a memory mapped ring buffer containing ISP program | ||
| 1122 | * buffer information. | ||
| 1123 | */ | ||
| 1124 | iova_t programs_memoryinfo; | ||
| 1125 | |||
| 1126 | /** Size of the memoryinfo buffer reserved for each capture request. */ | ||
| 1127 | uint32_t request_memoryinfo_size; | ||
| 1128 | |||
| 1129 | /** Size of the memoryinfo buffer reserved for each program request. */ | ||
| 1130 | uint32_t program_memoryinfo_size; | ||
| 1131 | |||
| 1132 | uint32_t reserved; | ||
| 1133 | |||
| 1075 | /** Error action attributes */ | 1134 | /** Error action attributes */ |
| 1076 | uint32_t error_mask_correctable; | 1135 | uint32_t error_mask_correctable; |
| 1077 | uint32_t error_mask_uncorrectable; | 1136 | uint32_t error_mask_uncorrectable; |
| @@ -1091,10 +1150,10 @@ struct capture_channel_isp_config { | |||
| 1091 | * configuration. | 1150 | * configuration. |
| 1092 | */ | 1151 | */ |
| 1093 | uint32_t num_isp_gos_tables; | 1152 | uint32_t num_isp_gos_tables; |
| 1094 | uint32_t __pad_chan2; | ||
| 1095 | iova_t isp_gos_tables[ISP_NUM_GOS_TABLES]; | 1153 | iova_t isp_gos_tables[ISP_NUM_GOS_TABLES]; |
| 1096 | } __CAPTURE_IVC_ALIGN; | 1154 | } __CAPTURE_IVC_ALIGN; |
| 1097 | 1155 | ||
| 1156 | |||
| 1098 | struct capture_isp_status { | 1157 | struct capture_isp_status { |
| 1099 | uint8_t chan_id; | 1158 | uint8_t chan_id; |
| 1100 | uint8_t __pad; | 1159 | uint8_t __pad; |
| @@ -1108,7 +1167,6 @@ struct capture_isp_status { | |||
| 1108 | #define CAPTURE_ISP_STATUS_ERROR U32_C(2) | 1167 | #define CAPTURE_ISP_STATUS_ERROR U32_C(2) |
| 1109 | } __CAPTURE_IVC_ALIGN; | 1168 | } __CAPTURE_IVC_ALIGN; |
| 1110 | 1169 | ||
| 1111 | |||
| 1112 | struct capture_isp_program_status { | 1170 | struct capture_isp_program_status { |
| 1113 | uint8_t chan_id; | 1171 | uint8_t chan_id; |
| 1114 | uint8_t settings_id; | 1172 | uint8_t settings_id; |
| @@ -1422,6 +1480,48 @@ struct isp_capture_descriptor { | |||
| 1422 | } __CAPTURE_DESCRIPTOR_ALIGN; | 1480 | } __CAPTURE_DESCRIPTOR_ALIGN; |
| 1423 | 1481 | ||
| 1424 | /** | 1482 | /** |
| 1483 | * @brief ISP capture descriptor memory information | ||
| 1484 | * | ||
| 1485 | * ISP capture descriptor memory information shared between | ||
| 1486 | * KMD and RCE only. This information cannot be part of | ||
| 1487 | * capture descriptor since it is shared with usermode | ||
| 1488 | * application. | ||
| 1489 | */ | ||
| 1490 | struct isp_capture_descriptor_memoryinfo { | ||
| 1491 | struct memoryinfo_surface input_mr_surfaces[ISP_MAX_INPUT_SURFACES]; | ||
| 1492 | struct { | ||
| 1493 | struct memoryinfo_surface surfaces[ISP_MAX_OUTPUT_SURFACES]; | ||
| 1494 | } outputs_mw[ISP_MAX_OUTPUTS]; | ||
| 1495 | |||
| 1496 | /** Flicker band (FB) statistics buffer */ | ||
| 1497 | struct memoryinfo_surface fb_surface; | ||
| 1498 | /** Focus metrics (FM) statistics buffer */ | ||
| 1499 | struct memoryinfo_surface fm_surface; | ||
| 1500 | /** Auto Focus Metrics (AFM) statistics buffer */ | ||
| 1501 | struct memoryinfo_surface afm_surface; // | ||
| 1502 | /** Local Average Clipping (LAC0) unit 0 statistics buffer */ | ||
| 1503 | struct memoryinfo_surface lac0_surface; | ||
| 1504 | /** Local Average Clipping (LAC1) unit 1 statistics buffer */ | ||
| 1505 | struct memoryinfo_surface lac1_surface; | ||
| 1506 | /** Histogram (H0) unit 0 statistics buffer */ | ||
| 1507 | struct memoryinfo_surface h0_surface; | ||
| 1508 | /** Histogram (H1) unit 1 statistics buffer */ | ||
| 1509 | struct memoryinfo_surface h1_surface; | ||
| 1510 | /** Pixel Replacement Unit (PRU) statistics buffer */ | ||
| 1511 | struct memoryinfo_surface pru_bad_surface; | ||
| 1512 | /** Local Tone Mapping statistics buffer */ | ||
| 1513 | struct memoryinfo_surface ltm_surface; | ||
| 1514 | /** RAW24 Histogram Unit statistics buffer */ | ||
| 1515 | struct memoryinfo_surface hist_raw24_surface; | ||
| 1516 | /** Base address of ISP PB2 memory */ | ||
| 1517 | struct memoryinfo_surface isp_pb2_mem; | ||
| 1518 | /** Engine result record – written by Falcon */ | ||
| 1519 | struct memoryinfo_surface engine_status; | ||
| 1520 | /* Reserved */ | ||
| 1521 | uint64_t reserved[6]; | ||
| 1522 | } __CAPTURE_DESCRIPTOR_ALIGN; | ||
| 1523 | |||
| 1524 | /** | ||
| 1425 | * PB2 size (ATOM aligned). | 1525 | * PB2 size (ATOM aligned). |
| 1426 | * | 1526 | * |
| 1427 | * NvCapture UMD makes sure to place PB2 just after above capture | 1527 | * NvCapture UMD makes sure to place PB2 just after above capture |
| @@ -1441,6 +1541,10 @@ struct isp_capture_descriptor { | |||
| 1441 | */ | 1541 | */ |
| 1442 | #define NVISP5_SURFACE_PB_SIZE 512 | 1542 | #define NVISP5_SURFACE_PB_SIZE 512 |
| 1443 | 1543 | ||
| 1544 | /** | ||
| 1545 | * @Size of engine status surface used in both VI and ISP | ||
| 1546 | */ | ||
| 1547 | #define NV_ENGINE_STATUS_SURFACE_SIZE 16 | ||
| 1444 | 1548 | ||
| 1445 | /** | 1549 | /** |
| 1446 | * Downscaler configuration information that is needed for building ISP | 1550 | * Downscaler configuration information that is needed for building ISP |
