| .. | .. |
|---|
| 38 | 38 | #define VSP1_VIDEO_DEF_WIDTH 1024 |
|---|
| 39 | 39 | #define VSP1_VIDEO_DEF_HEIGHT 768 |
|---|
| 40 | 40 | |
|---|
| 41 | | -#define VSP1_VIDEO_MIN_WIDTH 2U |
|---|
| 42 | 41 | #define VSP1_VIDEO_MAX_WIDTH 8190U |
|---|
| 43 | | -#define VSP1_VIDEO_MIN_HEIGHT 2U |
|---|
| 44 | 42 | #define VSP1_VIDEO_MAX_HEIGHT 8190U |
|---|
| 45 | 43 | |
|---|
| 46 | 44 | /* ----------------------------------------------------------------------------- |
|---|
| .. | .. |
|---|
| 136 | 134 | height = round_down(height, info->vsub); |
|---|
| 137 | 135 | |
|---|
| 138 | 136 | /* Clamp the width and height. */ |
|---|
| 139 | | - pix->width = clamp(width, VSP1_VIDEO_MIN_WIDTH, VSP1_VIDEO_MAX_WIDTH); |
|---|
| 140 | | - pix->height = clamp(height, VSP1_VIDEO_MIN_HEIGHT, |
|---|
| 141 | | - VSP1_VIDEO_MAX_HEIGHT); |
|---|
| 137 | + pix->width = clamp(width, info->hsub, VSP1_VIDEO_MAX_WIDTH); |
|---|
| 138 | + pix->height = clamp(height, info->vsub, VSP1_VIDEO_MAX_HEIGHT); |
|---|
| 142 | 139 | |
|---|
| 143 | 140 | /* |
|---|
| 144 | 141 | * Compute and clamp the stride and image size. While not documented in |
|---|
| .. | .. |
|---|
| 226 | 223 | * If the modulus is less than half of the partition size, |
|---|
| 227 | 224 | * the penultimate partition is reduced to half, which is added |
|---|
| 228 | 225 | * to the final partition: |1234|1234|1234|12|341| |
|---|
| 229 | | - * to prevents this: |1234|1234|1234|1234|1|. |
|---|
| 226 | + * to prevent this: |1234|1234|1234|1234|1|. |
|---|
| 230 | 227 | */ |
|---|
| 231 | 228 | if (modulus) { |
|---|
| 232 | 229 | /* |
|---|
| .. | .. |
|---|
| 310 | 307 | * This function completes the current buffer by filling its sequence number, |
|---|
| 311 | 308 | * time stamp and payload size, and hands it back to the videobuf core. |
|---|
| 312 | 309 | * |
|---|
| 313 | | - * When operating in DU output mode (deep pipeline to the DU through the LIF), |
|---|
| 314 | | - * the VSP1 needs to constantly supply frames to the display. In that case, if |
|---|
| 315 | | - * no other buffer is queued, reuse the one that has just been processed instead |
|---|
| 316 | | - * of handing it back to the videobuf core. |
|---|
| 317 | | - * |
|---|
| 318 | 310 | * Return the next queued buffer or NULL if the queue is empty. |
|---|
| 319 | 311 | */ |
|---|
| 320 | 312 | static struct vsp1_vb2_buffer * |
|---|
| .. | .. |
|---|
| 335 | 327 | |
|---|
| 336 | 328 | done = list_first_entry(&video->irqqueue, |
|---|
| 337 | 329 | struct vsp1_vb2_buffer, queue); |
|---|
| 338 | | - |
|---|
| 339 | | - /* In DU output mode reuse the buffer if the list is singular. */ |
|---|
| 340 | | - if (pipe->lif && list_is_singular(&video->irqqueue)) { |
|---|
| 341 | | - spin_unlock_irqrestore(&video->irqlock, flags); |
|---|
| 342 | | - return done; |
|---|
| 343 | | - } |
|---|
| 344 | 330 | |
|---|
| 345 | 331 | list_del(&done->queue); |
|---|
| 346 | 332 | |
|---|
| .. | .. |
|---|
| 435 | 421 | } |
|---|
| 436 | 422 | |
|---|
| 437 | 423 | /* Complete, and commit the head display list. */ |
|---|
| 438 | | - vsp1_dl_list_commit(dl, false); |
|---|
| 424 | + vsp1_dl_list_commit(dl, 0); |
|---|
| 439 | 425 | pipe->configured = true; |
|---|
| 440 | 426 | |
|---|
| 441 | 427 | vsp1_pipeline_run(pipe); |
|---|
| .. | .. |
|---|
| 839 | 825 | |
|---|
| 840 | 826 | list_for_each_entry(entity, &pipe->entities, list_pipe) { |
|---|
| 841 | 827 | vsp1_entity_route_setup(entity, pipe, pipe->stream_config); |
|---|
| 842 | | - vsp1_entity_configure_stream(entity, pipe, pipe->stream_config); |
|---|
| 828 | + vsp1_entity_configure_stream(entity, pipe, NULL, |
|---|
| 829 | + pipe->stream_config); |
|---|
| 843 | 830 | } |
|---|
| 844 | 831 | |
|---|
| 845 | 832 | return 0; |
|---|
| .. | .. |
|---|
| 867 | 854 | pipe->stream_config = NULL; |
|---|
| 868 | 855 | pipe->configured = false; |
|---|
| 869 | 856 | |
|---|
| 870 | | - /* Release our partition table allocation */ |
|---|
| 857 | + /* Release our partition table allocation. */ |
|---|
| 871 | 858 | kfree(pipe->part_table); |
|---|
| 872 | 859 | pipe->part_table = NULL; |
|---|
| 873 | 860 | } |
|---|
| .. | .. |
|---|
| 969 | 956 | | V4L2_CAP_VIDEO_CAPTURE_MPLANE |
|---|
| 970 | 957 | | V4L2_CAP_VIDEO_OUTPUT_MPLANE; |
|---|
| 971 | 958 | |
|---|
| 972 | | - if (video->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) |
|---|
| 973 | | - cap->device_caps = V4L2_CAP_VIDEO_CAPTURE_MPLANE |
|---|
| 974 | | - | V4L2_CAP_STREAMING; |
|---|
| 975 | | - else |
|---|
| 976 | | - cap->device_caps = V4L2_CAP_VIDEO_OUTPUT_MPLANE |
|---|
| 977 | | - | V4L2_CAP_STREAMING; |
|---|
| 978 | 959 | |
|---|
| 979 | | - strlcpy(cap->driver, "vsp1", sizeof(cap->driver)); |
|---|
| 980 | | - strlcpy(cap->card, video->video.name, sizeof(cap->card)); |
|---|
| 960 | + strscpy(cap->driver, "vsp1", sizeof(cap->driver)); |
|---|
| 961 | + strscpy(cap->card, video->video.name, sizeof(cap->card)); |
|---|
| 981 | 962 | snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", |
|---|
| 982 | 963 | dev_name(video->vsp1->dev)); |
|---|
| 983 | 964 | |
|---|
| .. | .. |
|---|
| 1281 | 1262 | video->type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; |
|---|
| 1282 | 1263 | video->pad.flags = MEDIA_PAD_FL_SOURCE; |
|---|
| 1283 | 1264 | video->video.vfl_dir = VFL_DIR_TX; |
|---|
| 1265 | + video->video.device_caps = V4L2_CAP_VIDEO_OUTPUT_MPLANE | |
|---|
| 1266 | + V4L2_CAP_STREAMING; |
|---|
| 1284 | 1267 | } else { |
|---|
| 1285 | 1268 | direction = "output"; |
|---|
| 1286 | 1269 | video->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; |
|---|
| 1287 | 1270 | video->pad.flags = MEDIA_PAD_FL_SINK; |
|---|
| 1288 | 1271 | video->video.vfl_dir = VFL_DIR_RX; |
|---|
| 1272 | + video->video.device_caps = V4L2_CAP_VIDEO_CAPTURE_MPLANE | |
|---|
| 1273 | + V4L2_CAP_STREAMING; |
|---|
| 1289 | 1274 | } |
|---|
| 1290 | 1275 | |
|---|
| 1291 | 1276 | mutex_init(&video->lock); |
|---|
| .. | .. |
|---|
| 1308 | 1293 | video->video.fops = &vsp1_video_fops; |
|---|
| 1309 | 1294 | snprintf(video->video.name, sizeof(video->video.name), "%s %s", |
|---|
| 1310 | 1295 | rwpf->entity.subdev.name, direction); |
|---|
| 1311 | | - video->video.vfl_type = VFL_TYPE_GRABBER; |
|---|
| 1296 | + video->video.vfl_type = VFL_TYPE_VIDEO; |
|---|
| 1312 | 1297 | video->video.release = video_device_release_empty; |
|---|
| 1313 | 1298 | video->video.ioctl_ops = &vsp1_video_ioctl_ops; |
|---|
| 1314 | 1299 | |
|---|
| .. | .. |
|---|
| 1331 | 1316 | |
|---|
| 1332 | 1317 | /* ... and register the video device. */ |
|---|
| 1333 | 1318 | video->video.queue = &video->queue; |
|---|
| 1334 | | - ret = video_register_device(&video->video, VFL_TYPE_GRABBER, -1); |
|---|
| 1319 | + ret = video_register_device(&video->video, VFL_TYPE_VIDEO, -1); |
|---|
| 1335 | 1320 | if (ret < 0) { |
|---|
| 1336 | 1321 | dev_err(video->vsp1->dev, "failed to register video device\n"); |
|---|
| 1337 | 1322 | goto error; |
|---|