Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] media: videobuf2: Move timestamp to vb2_buffer

Move timestamp from struct vb2_v4l2_buffer to struct vb2_buffer
for common use, and change its type to u64 in order to handling
y2038 problem. This patch also includes all device drivers' changes related to
this restructuring.

Signed-off-by: Junghak Sung <jh1009.sung@samsung.com>
Signed-off-by: Geunyoung Kim <nenggun.kim@samsung.com>
Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Junghak Sung and committed by
Mauro Carvalho Chehab
d6dd645e 9057bc2b

+108 -106
+1 -1
drivers/input/touchscreen/sur40.c
··· 444 444 goto err_poll; 445 445 446 446 /* mark as finished */ 447 - v4l2_get_timestamp(&new_buf->vb.timestamp); 447 + new_buf->vb.vb2_buf.timestamp = ktime_get_ns(); 448 448 new_buf->vb.sequence = sur40->sequence++; 449 449 new_buf->vb.field = V4L2_FIELD_NONE; 450 450 vb2_buffer_done(&new_buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
+1 -1
drivers/media/dvb-frontends/rtl2832_sdr.c
··· 310 310 len = rtl2832_sdr_convert_stream(dev, ptr, urb->transfer_buffer, 311 311 urb->actual_length); 312 312 vb2_set_plane_payload(&fbuf->vb.vb2_buf, 0, len); 313 - v4l2_get_timestamp(&fbuf->vb.timestamp); 313 + fbuf->vb.vb2_buf.timestamp = ktime_get_ns(); 314 314 fbuf->vb.sequence = dev->sequence++; 315 315 vb2_buffer_done(&fbuf->vb.vb2_buf, VB2_BUF_STATE_DONE); 316 316 }
+1 -1
drivers/media/pci/cobalt/cobalt-irq.c
··· 134 134 skip = true; 135 135 s->skip_first_frames--; 136 136 } 137 - v4l2_get_timestamp(&cb->vb.timestamp); 137 + cb->vb.vb2_buf.timestamp = ktime_get_ns(); 138 138 /* TODO: the sequence number should be read from the FPGA so we 139 139 also know about dropped frames. */ 140 140 cb->vb.sequence = s->sequence++;
+1 -1
drivers/media/pci/cx23885/cx23885-core.c
··· 427 427 buf = list_entry(q->active.next, 428 428 struct cx23885_buffer, queue); 429 429 430 - v4l2_get_timestamp(&buf->vb.timestamp); 430 + buf->vb.vb2_buf.timestamp = ktime_get_ns(); 431 431 buf->vb.sequence = q->count++; 432 432 dprintk(1, "[%p/%d] wakeup reg=%d buf=%d\n", buf, 433 433 buf->vb.vb2_buf.index,
+1 -1
drivers/media/pci/cx23885/cx23885-video.c
··· 105 105 struct cx23885_buffer, queue); 106 106 107 107 buf->vb.sequence = q->count++; 108 - v4l2_get_timestamp(&buf->vb.timestamp); 108 + buf->vb.vb2_buf.timestamp = ktime_get_ns(); 109 109 dprintk(2, "[%p/%d] wakeup reg=%d buf=%d\n", buf, 110 110 buf->vb.vb2_buf.index, count, q->count); 111 111 list_del(&buf->queue);
+1 -1
drivers/media/pci/cx25821/cx25821-video.c
··· 130 130 buf = list_entry(dmaq->active.next, 131 131 struct cx25821_buffer, queue); 132 132 133 - v4l2_get_timestamp(&buf->vb.timestamp); 133 + buf->vb.vb2_buf.timestamp = ktime_get_ns(); 134 134 buf->vb.sequence = dmaq->count++; 135 135 list_del(&buf->queue); 136 136 vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
+1 -1
drivers/media/pci/cx88/cx88-core.c
··· 518 518 519 519 buf = list_entry(q->active.next, 520 520 struct cx88_buffer, list); 521 - v4l2_get_timestamp(&buf->vb.timestamp); 521 + buf->vb.vb2_buf.timestamp = ktime_get_ns(); 522 522 buf->vb.field = core->field; 523 523 buf->vb.sequence = q->count++; 524 524 list_del(&buf->list);
+1 -1
drivers/media/pci/dt3155/dt3155.c
··· 270 270 271 271 spin_lock(&ipd->lock); 272 272 if (ipd->curr_buf && !list_empty(&ipd->dmaq)) { 273 - v4l2_get_timestamp(&ipd->curr_buf->timestamp); 273 + ipd->curr_buf->vb2_buf.timestamp = ktime_get_ns(); 274 274 ipd->curr_buf->sequence = ipd->sequence++; 275 275 ipd->curr_buf->field = V4L2_FIELD_NONE; 276 276 vb2_buffer_done(&ipd->curr_buf->vb2_buf, VB2_BUF_STATE_DONE);
+1 -1
drivers/media/pci/netup_unidvb/netup_unidvb_core.c
··· 579 579 dev_dbg(&ndev->pci_dev->dev, 580 580 "%s(): buffer %p done, size %d\n", 581 581 __func__, buf, buf->size); 582 - v4l2_get_timestamp(&buf->vb.timestamp); 582 + buf->vb.vb2_buf.timestamp = ktime_get_ns(); 583 583 vb2_set_plane_payload(&buf->vb.vb2_buf, 0, buf->size); 584 584 vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE); 585 585 }
+1 -1
drivers/media/pci/saa7134/saa7134-core.c
··· 309 309 core_dbg("buffer_finish %p\n", q->curr); 310 310 311 311 /* finish current buffer */ 312 - v4l2_get_timestamp(&q->curr->vb2.timestamp); 312 + q->curr->vb2.vb2_buf.timestamp = ktime_get_ns(); 313 313 q->curr->vb2.sequence = q->seq_nr++; 314 314 vb2_buffer_done(&q->curr->vb2.vb2_buf, state); 315 315 q->curr = NULL;
+1 -1
drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c
··· 531 531 532 532 if (!ret) { 533 533 vbuf->sequence = solo_enc->sequence++; 534 - v4l2_get_timestamp(&vbuf->timestamp); 534 + vb->timestamp = ktime_get_ns(); 535 535 536 536 /* Check for motion flags */ 537 537 if (solo_is_motion_on(solo_enc) && enc_buf->motion) {
+1 -1
drivers/media/pci/solo6x10/solo6x10-v4l2.c
··· 225 225 vb2_set_plane_payload(vb, 0, 226 226 solo_vlines(solo_dev) * solo_bytesperline(solo_dev)); 227 227 vbuf->sequence = solo_dev->sequence++; 228 - v4l2_get_timestamp(&vbuf->timestamp); 228 + vb->timestamp = ktime_get_ns(); 229 229 } 230 230 231 231 vb2_buffer_done(vb, error ? VB2_BUF_STATE_ERROR : VB2_BUF_STATE_DONE);
+1 -1
drivers/media/pci/sta2x11/sta2x11_vip.c
··· 817 817 /* Disable acquisition */ 818 818 reg_write(vip, DVP_CTL, reg_read(vip, DVP_CTL) & ~DVP_CTL_ENA); 819 819 /* Remove the active buffer from the list */ 820 - v4l2_get_timestamp(&vip->active->vb.timestamp); 820 + vip->active->vb.vb2_buf.timestamp = ktime_get_ns(); 821 821 vip->active->vb.sequence = vip->sequence++; 822 822 vb2_buffer_done(&vip->active->vb.vb2_buf, VB2_BUF_STATE_DONE); 823 823 }
+1 -1
drivers/media/pci/tw68/tw68-video.c
··· 1016 1016 buf = list_entry(dev->active.next, struct tw68_buf, list); 1017 1017 list_del(&buf->list); 1018 1018 spin_unlock(&dev->slock); 1019 - v4l2_get_timestamp(&buf->vb.timestamp); 1019 + buf->vb.vb2_buf.timestamp = ktime_get_ns(); 1020 1020 buf->vb.field = dev->field; 1021 1021 buf->vb.sequence = dev->seqnr++; 1022 1022 vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
+1 -1
drivers/media/platform/am437x/am437x-vpfe.c
··· 1281 1281 */ 1282 1282 static inline void vpfe_process_buffer_complete(struct vpfe_device *vpfe) 1283 1283 { 1284 - v4l2_get_timestamp(&vpfe->cur_frm->vb.timestamp); 1284 + vpfe->cur_frm->vb.vb2_buf.timestamp = ktime_get_ns(); 1285 1285 vpfe->cur_frm->vb.field = vpfe->fmt.fmt.pix.field; 1286 1286 vpfe->cur_frm->vb.sequence = vpfe->sequence++; 1287 1287 vb2_buffer_done(&vpfe->cur_frm->vb.vb2_buf, VB2_BUF_STATE_DONE);
+1 -1
drivers/media/platform/blackfin/bfin_capture.c
··· 404 404 spin_lock(&bcap_dev->lock); 405 405 406 406 if (!list_empty(&bcap_dev->dma_queue)) { 407 - v4l2_get_timestamp(&vbuf->timestamp); 407 + vb->timestamp = ktime_get_ns(); 408 408 if (ppi->err) { 409 409 vb2_buffer_done(vb, VB2_BUF_STATE_ERROR); 410 410 ppi->err = false;
+3 -3
drivers/media/platform/coda/coda-bit.c
··· 279 279 if (meta) { 280 280 meta->sequence = src_buf->sequence; 281 281 meta->timecode = src_buf->timecode; 282 - meta->timestamp = src_buf->timestamp; 282 + meta->timestamp = src_buf->vb2_buf.timestamp; 283 283 meta->start = start; 284 284 meta->end = ctx->bitstream_fifo.kfifo.in & 285 285 ctx->bitstream_fifo.kfifo.mask; ··· 1364 1364 dst_buf->flags &= ~V4L2_BUF_FLAG_KEYFRAME; 1365 1365 } 1366 1366 1367 - dst_buf->timestamp = src_buf->timestamp; 1367 + dst_buf->vb2_buf.timestamp = src_buf->vb2_buf.timestamp; 1368 1368 dst_buf->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK; 1369 1369 dst_buf->flags |= 1370 1370 src_buf->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK; ··· 2040 2040 dst_buf->flags |= ctx->frame_types[ctx->display_idx]; 2041 2041 meta = &ctx->frame_metas[ctx->display_idx]; 2042 2042 dst_buf->timecode = meta->timecode; 2043 - dst_buf->timestamp = meta->timestamp; 2043 + dst_buf->vb2_buf.timestamp = meta->timestamp; 2044 2044 2045 2045 trace_coda_dec_rot_done(ctx, dst_buf, meta); 2046 2046
+1 -1
drivers/media/platform/coda/coda.h
··· 138 138 struct list_head list; 139 139 u32 sequence; 140 140 struct v4l2_timecode timecode; 141 - struct timeval timestamp; 141 + u64 timestamp; 142 142 u32 start; 143 143 u32 end; 144 144 };
+1 -1
drivers/media/platform/davinci/vpbe_display.c
··· 74 74 if (layer->cur_frm == layer->next_frm) 75 75 return; 76 76 77 - v4l2_get_timestamp(&layer->cur_frm->vb.timestamp); 77 + layer->cur_frm->vb.vb2_buf.timestamp = ktime_get_ns(); 78 78 vb2_buffer_done(&layer->cur_frm->vb.vb2_buf, VB2_BUF_STATE_DONE); 79 79 /* Make cur_frm pointing to next_frm */ 80 80 layer->cur_frm = layer->next_frm;
+1 -1
drivers/media/platform/davinci/vpif_capture.c
··· 330 330 */ 331 331 static void vpif_process_buffer_complete(struct common_obj *common) 332 332 { 333 - v4l2_get_timestamp(&common->cur_frm->vb.timestamp); 333 + common->cur_frm->vb.vb2_buf.timestamp = ktime_get_ns(); 334 334 vb2_buffer_done(&common->cur_frm->vb.vb2_buf, VB2_BUF_STATE_DONE); 335 335 /* Make curFrm pointing to nextFrm */ 336 336 common->cur_frm = common->next_frm;
+3 -3
drivers/media/platform/davinci/vpif_display.c
··· 331 331 /* one frame is displayed If next frame is 332 332 * available, release cur_frm and move on */ 333 333 /* Copy frame display time */ 334 - v4l2_get_timestamp(&common->cur_frm->vb.timestamp); 334 + common->cur_frm->vb.vb2_buf.timestamp = ktime_get_ns(); 335 335 /* Change status of the cur_frm */ 336 336 vb2_buffer_done(&common->cur_frm->vb.vb2_buf, 337 337 VB2_BUF_STATE_DONE); ··· 387 387 if (!channel_first_int[i][channel_id]) { 388 388 /* Mark status of the cur_frm to 389 389 * done and unlock semaphore on it */ 390 - v4l2_get_timestamp( 391 - &common->cur_frm->vb.timestamp); 390 + common->cur_frm->vb.vb2_buf.timestamp = 391 + ktime_get_ns(); 392 392 vb2_buffer_done(&common->cur_frm->vb.vb2_buf, 393 393 VB2_BUF_STATE_DONE); 394 394 /* Make cur_frm pointing to next_frm */
+2 -2
drivers/media/platform/exynos-gsc/gsc-m2m.c
··· 86 86 dst_vb = v4l2_m2m_dst_buf_remove(ctx->m2m_ctx); 87 87 88 88 if (src_vb && dst_vb) { 89 - dst_vb->timestamp = src_vb->timestamp; 89 + dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp; 90 90 dst_vb->timecode = src_vb->timecode; 91 91 dst_vb->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK; 92 92 dst_vb->flags |= ··· 125 125 if (ret) 126 126 return ret; 127 127 128 - dst_vb->timestamp = src_vb->timestamp; 128 + dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp; 129 129 130 130 return 0; 131 131 }
+1 -1
drivers/media/platform/exynos4-is/fimc-capture.c
··· 193 193 test_bit(ST_CAPT_RUN, &fimc->state) && deq_buf) { 194 194 v_buf = fimc_active_queue_pop(cap); 195 195 196 - v4l2_get_timestamp(&v_buf->vb.timestamp); 196 + v_buf->vb.vb2_buf.timestamp = ktime_get_ns(); 197 197 v_buf->vb.sequence = cap->frame_count++; 198 198 199 199 vb2_buffer_done(&v_buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
+1 -1
drivers/media/platform/exynos4-is/fimc-isp-video.c
··· 251 251 buf_index = (is->i2h_cmd.args[1] - 1) % video->buf_count; 252 252 vbuf = &video->buffers[buf_index]->vb; 253 253 254 - v4l2_get_timestamp(&vbuf->timestamp); 254 + vbuf->vb2_buf.timestamp = ktime_get_ns(); 255 255 vb2_buffer_done(&vbuf->vb2_buf, VB2_BUF_STATE_DONE); 256 256 257 257 video->buf_mask &= ~BIT(buf_index);
+1 -1
drivers/media/platform/exynos4-is/fimc-lite.c
··· 292 292 test_bit(ST_FLITE_RUN, &fimc->state) && 293 293 !list_empty(&fimc->active_buf_q)) { 294 294 vbuf = fimc_lite_active_queue_pop(fimc); 295 - v4l2_get_timestamp(&vbuf->vb.timestamp); 295 + vbuf->vb.vb2_buf.timestamp = ktime_get_ns(); 296 296 vbuf->vb.sequence = fimc->frame_count++; 297 297 flite_hw_mask_dma_buffer(fimc, vbuf->index); 298 298 vb2_buffer_done(&vbuf->vb.vb2_buf, VB2_BUF_STATE_DONE);
+1 -1
drivers/media/platform/exynos4-is/fimc-m2m.c
··· 132 132 if (ret) 133 133 goto dma_unlock; 134 134 135 - dst_vb->timestamp = src_vb->timestamp; 135 + dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp; 136 136 dst_vb->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK; 137 137 dst_vb->flags |= 138 138 src_vb->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
+1 -1
drivers/media/platform/m2m-deinterlace.c
··· 207 207 src_vb = v4l2_m2m_src_buf_remove(curr_ctx->m2m_ctx); 208 208 dst_vb = v4l2_m2m_dst_buf_remove(curr_ctx->m2m_ctx); 209 209 210 - dst_vb->timestamp = src_vb->timestamp; 210 + dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp; 211 211 dst_vb->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK; 212 212 dst_vb->flags |= 213 213 src_vb->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
+1 -1
drivers/media/platform/marvell-ccic/mcam-core.c
··· 226 226 vbuf->vb2_buf.planes[0].bytesused = cam->pix_format.sizeimage; 227 227 vbuf->sequence = cam->buf_seq[frame]; 228 228 vbuf->field = V4L2_FIELD_NONE; 229 - v4l2_get_timestamp(&vbuf->timestamp); 229 + vbuf->vb2_buf.timestamp = ktime_get_ns(); 230 230 vb2_set_plane_payload(&vbuf->vb2_buf, 0, cam->pix_format.sizeimage); 231 231 vb2_buffer_done(&vbuf->vb2_buf, VB2_BUF_STATE_DONE); 232 232 }
+1 -1
drivers/media/platform/mx2_emmaprp.c
··· 375 375 src_vb = v4l2_m2m_src_buf_remove(curr_ctx->m2m_ctx); 376 376 dst_vb = v4l2_m2m_dst_buf_remove(curr_ctx->m2m_ctx); 377 377 378 - dst_vb->timestamp = src_vb->timestamp; 378 + dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp; 379 379 dst_vb->flags &= 380 380 ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK; 381 381 dst_vb->flags |=
+1 -1
drivers/media/platform/omap3isp/ispvideo.c
··· 466 466 list_del(&buf->irqlist); 467 467 spin_unlock_irqrestore(&video->irqlock, flags); 468 468 469 - v4l2_get_timestamp(&buf->vb.timestamp); 469 + buf->vb.vb2_buf.timestamp = ktime_get_ns(); 470 470 471 471 /* Do frame number propagation only if this is the output video node. 472 472 * Frame number either comes from the CSI receivers or it gets
+1 -1
drivers/media/platform/rcar_jpu.c
··· 1565 1565 } 1566 1566 1567 1567 dst_buf->field = src_buf->field; 1568 - dst_buf->timestamp = src_buf->timestamp; 1568 + dst_buf->vb2_buf.timestamp = src_buf->vb2_buf.timestamp; 1569 1569 if (src_buf->flags & V4L2_BUF_FLAG_TIMECODE) 1570 1570 dst_buf->timecode = src_buf->timecode; 1571 1571 dst_buf->flags = src_buf->flags &
+1 -1
drivers/media/platform/s3c-camif/camif-capture.c
··· 338 338 339 339 if (!WARN_ON(vbuf == NULL)) { 340 340 /* Dequeue a filled buffer */ 341 - v4l2_get_timestamp(&vbuf->vb.timestamp); 341 + vbuf->vb.vb2_buf.timestamp = ktime_get_ns(); 342 342 vbuf->vb.sequence = vp->frame_sequence++; 343 343 vb2_buffer_done(&vbuf->vb.vb2_buf, VB2_BUF_STATE_DONE); 344 344
+1 -1
drivers/media/platform/s5p-g2d/g2d.c
··· 552 552 BUG_ON(dst == NULL); 553 553 554 554 dst->timecode = src->timecode; 555 - dst->timestamp = src->timestamp; 555 + dst->vb2_buf.timestamp = src->vb2_buf.timestamp; 556 556 dst->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK; 557 557 dst->flags |= 558 558 src->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
+2 -2
drivers/media/platform/s5p-jpeg/jpeg-core.c
··· 2620 2620 } 2621 2621 2622 2622 dst_buf->timecode = src_buf->timecode; 2623 - dst_buf->timestamp = src_buf->timestamp; 2623 + dst_buf->vb2_buf.timestamp = src_buf->vb2_buf.timestamp; 2624 2624 dst_buf->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK; 2625 2625 dst_buf->flags |= 2626 2626 src_buf->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK; ··· 2751 2751 dst_buf = v4l2_m2m_dst_buf_remove(curr_ctx->fh.m2m_ctx); 2752 2752 2753 2753 dst_buf->timecode = src_buf->timecode; 2754 - dst_buf->timestamp = src_buf->timestamp; 2754 + dst_buf->vb2_buf.timestamp = src_buf->vb2_buf.timestamp; 2755 2755 2756 2756 v4l2_m2m_buf_done(src_buf, state); 2757 2757 if (curr_ctx->mode == S5P_JPEG_ENCODE)
+2 -2
drivers/media/platform/s5p-mfc/s5p_mfc.c
··· 233 233 == dec_y_addr) { 234 234 dst_buf->b->timecode = 235 235 src_buf->b->timecode; 236 - dst_buf->b->timestamp = 237 - src_buf->b->timestamp; 236 + dst_buf->b->vb2_buf.timestamp = 237 + src_buf->b->vb2_buf.timestamp; 238 238 dst_buf->b->flags &= 239 239 ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK; 240 240 dst_buf->b->flags |=
+1 -1
drivers/media/platform/sh_veu.c
··· 1094 1094 if (!src || !dst) 1095 1095 return IRQ_NONE; 1096 1096 1097 - dst->timestamp = src->timestamp; 1097 + dst->vb2_buf.timestamp = src->vb2_buf.timestamp; 1098 1098 dst->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK; 1099 1099 dst->flags |= 1100 1100 src->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
+1 -1
drivers/media/platform/sh_vou.c
··· 1070 1070 1071 1071 list_del(&vb->list); 1072 1072 1073 - v4l2_get_timestamp(&vb->vb.timestamp); 1073 + vb->vb.vb2_buf.timestamp = ktime_get_ns(); 1074 1074 vb->vb.sequence = vou_dev->sequence++; 1075 1075 vb->vb.field = V4L2_FIELD_INTERLACED; 1076 1076 vb2_buffer_done(&vb->vb.vb2_buf, VB2_BUF_STATE_DONE);
+1 -1
drivers/media/platform/soc_camera/atmel-isi.c
··· 214 214 struct frame_buffer *buf = isi->active; 215 215 216 216 list_del_init(&buf->list); 217 - v4l2_get_timestamp(&vbuf->timestamp); 217 + vbuf->vb2_buf.timestamp = ktime_get_ns(); 218 218 vbuf->sequence = isi->sequence++; 219 219 vb2_buffer_done(&vbuf->vb2_buf, VB2_BUF_STATE_DONE); 220 220 }
+1 -1
drivers/media/platform/soc_camera/mx2_camera.c
··· 1345 1345 vb2_get_plane_payload(vb, 0)); 1346 1346 1347 1347 list_del_init(&buf->internal.queue); 1348 - v4l2_get_timestamp(&vbuf->timestamp); 1348 + vb->timestamp = ktime_get_ns(); 1349 1349 vbuf->sequence = pcdev->frame_count; 1350 1350 if (err) 1351 1351 vb2_buffer_done(vb, VB2_BUF_STATE_ERROR);
+1 -1
drivers/media/platform/soc_camera/mx3_camera.c
··· 155 155 struct mx3_camera_buffer *buf = to_mx3_vb(vb); 156 156 157 157 list_del_init(&buf->queue); 158 - v4l2_get_timestamp(&vb->timestamp); 158 + vb->vb2_buf.timestamp = ktime_get_ns(); 159 159 vb->field = mx3_cam->field; 160 160 vb->sequence = mx3_cam->sequence++; 161 161 vb2_buffer_done(&vb->vb2_buf, VB2_BUF_STATE_DONE);
+1 -1
drivers/media/platform/soc_camera/rcar_vin.c
··· 888 888 889 889 priv->queue_buf[slot]->field = priv->field; 890 890 priv->queue_buf[slot]->sequence = priv->sequence++; 891 - v4l2_get_timestamp(&priv->queue_buf[slot]->timestamp); 891 + priv->queue_buf[slot]->vb2_buf.timestamp = ktime_get_ns(); 892 892 vb2_buffer_done(&priv->queue_buf[slot]->vb2_buf, 893 893 VB2_BUF_STATE_DONE); 894 894 priv->queue_buf[slot] = NULL;
+1 -1
drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
··· 510 510 pcdev->active = NULL; 511 511 512 512 ret = sh_mobile_ceu_capture(pcdev); 513 - v4l2_get_timestamp(&vbuf->timestamp); 513 + vbuf->vb2_buf.timestamp = ktime_get_ns(); 514 514 if (!ret) { 515 515 vbuf->field = pcdev->field; 516 516 vbuf->sequence = pcdev->sequence++;
+2 -2
drivers/media/platform/sti/bdisp/bdisp-v4l2.c
··· 191 191 dst_vb = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx); 192 192 193 193 if (src_vb && dst_vb) { 194 - dst_vb->timestamp = src_vb->timestamp; 194 + dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp; 195 195 dst_vb->timecode = src_vb->timecode; 196 196 dst_vb->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK; 197 197 dst_vb->flags |= src_vb->flags & ··· 297 297 if (ret) 298 298 return ret; 299 299 300 - dst_vb->timestamp = src_vb->timestamp; 300 + dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp; 301 301 302 302 return 0; 303 303 }
+1 -1
drivers/media/platform/ti-vpe/vpe.c
··· 1288 1288 d_vb = ctx->dst_vb; 1289 1289 1290 1290 d_vb->flags = s_vb->flags; 1291 - d_vb->timestamp = s_vb->timestamp; 1291 + d_vb->vb2_buf.timestamp = s_vb->vb2_buf.timestamp; 1292 1292 1293 1293 if (s_vb->flags & V4L2_BUF_FLAG_TIMECODE) 1294 1294 d_vb->timecode = s_vb->timecode;
+1 -1
drivers/media/platform/vim2m.c
··· 235 235 out_vb->sequence = 236 236 get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE)->sequence++; 237 237 in_vb->sequence = q_data->sequence++; 238 - out_vb->timestamp = in_vb->timestamp; 238 + out_vb->vb2_buf.timestamp = in_vb->vb2_buf.timestamp; 239 239 240 240 if (in_vb->flags & V4L2_BUF_FLAG_TIMECODE) 241 241 out_vb->timecode = in_vb->timecode;
+1 -1
drivers/media/platform/vivid/vivid-core.h
··· 286 286 bool dqbuf_error; 287 287 bool seq_wrap; 288 288 bool time_wrap; 289 - __kernel_time_t time_wrap_offset; 289 + u64 time_wrap_offset; 290 290 unsigned perc_dropped_buffers; 291 291 enum vivid_signal_mode std_signal_mode; 292 292 unsigned query_std_last;
+11 -3
drivers/media/platform/vivid/vivid-ctrls.c
··· 954 954 static int vivid_streaming_s_ctrl(struct v4l2_ctrl *ctrl) 955 955 { 956 956 struct vivid_dev *dev = container_of(ctrl->handler, struct vivid_dev, ctrl_hdl_streaming); 957 - struct timeval tv; 957 + u64 rem; 958 958 959 959 switch (ctrl->id) { 960 960 case VIVID_CID_DQBUF_ERROR: ··· 993 993 dev->time_wrap_offset = 0; 994 994 break; 995 995 } 996 - v4l2_get_timestamp(&tv); 997 - dev->time_wrap_offset = -tv.tv_sec - 16; 996 + /* 997 + * We want to set the time 16 seconds before the 32 bit tv_sec 998 + * value of struct timeval would wrap around. So first we 999 + * calculate ktime_get_ns() % ((1 << 32) * NSEC_PER_SEC), and 1000 + * then we set the offset to ((1 << 32) - 16) * NSEC_PER_SEC). 1001 + */ 1002 + div64_u64_rem(ktime_get_ns(), 1003 + 0x100000000ULL * NSEC_PER_SEC, &rem); 1004 + dev->time_wrap_offset = 1005 + (0x100000000ULL - 16) * NSEC_PER_SEC - rem; 998 1006 break; 999 1007 } 1000 1008 return 0;
+3 -3
drivers/media/platform/vivid/vivid-kthread-cap.c
··· 441 441 * "Start of Exposure". 442 442 */ 443 443 if (dev->tstamp_src_is_soe) 444 - v4l2_get_timestamp(&buf->vb.timestamp); 444 + buf->vb.vb2_buf.timestamp = ktime_get_ns(); 445 445 if (dev->field_cap == V4L2_FIELD_ALTERNATE) { 446 446 /* 447 447 * 60 Hz standards start with the bottom field, 50 Hz standards ··· 558 558 * the timestamp now. 559 559 */ 560 560 if (!dev->tstamp_src_is_soe) 561 - v4l2_get_timestamp(&buf->vb.timestamp); 562 - buf->vb.timestamp.tv_sec += dev->time_wrap_offset; 561 + buf->vb.vb2_buf.timestamp = ktime_get_ns(); 562 + buf->vb.vb2_buf.timestamp += dev->time_wrap_offset; 563 563 } 564 564 565 565 /*
+4 -4
drivers/media/platform/vivid/vivid-kthread-out.c
··· 95 95 */ 96 96 vid_out_buf->vb.sequence /= 2; 97 97 } 98 - v4l2_get_timestamp(&vid_out_buf->vb.timestamp); 99 - vid_out_buf->vb.timestamp.tv_sec += dev->time_wrap_offset; 98 + vid_out_buf->vb.vb2_buf.timestamp = 99 + ktime_get_ns() + dev->time_wrap_offset; 100 100 vb2_buffer_done(&vid_out_buf->vb.vb2_buf, dev->dqbuf_error ? 101 101 VB2_BUF_STATE_ERROR : VB2_BUF_STATE_DONE); 102 102 dprintk(dev, 2, "vid_out buffer %d done\n", ··· 108 108 vivid_sliced_vbi_out_process(dev, vbi_out_buf); 109 109 110 110 vbi_out_buf->vb.sequence = dev->vbi_out_seq_count; 111 - v4l2_get_timestamp(&vbi_out_buf->vb.timestamp); 112 - vbi_out_buf->vb.timestamp.tv_sec += dev->time_wrap_offset; 111 + vbi_out_buf->vb.vb2_buf.timestamp = 112 + ktime_get_ns() + dev->time_wrap_offset; 113 113 vb2_buffer_done(&vbi_out_buf->vb.vb2_buf, dev->dqbuf_error ? 114 114 VB2_BUF_STATE_ERROR : VB2_BUF_STATE_DONE); 115 115 dprintk(dev, 2, "vbi_out buffer %d done\n",
+2 -2
drivers/media/platform/vivid/vivid-sdr-cap.c
··· 117 117 if (sdr_cap_buf) { 118 118 sdr_cap_buf->vb.sequence = dev->sdr_cap_seq_count; 119 119 vivid_sdr_cap_process(dev, sdr_cap_buf); 120 - v4l2_get_timestamp(&sdr_cap_buf->vb.timestamp); 121 - sdr_cap_buf->vb.timestamp.tv_sec += dev->time_wrap_offset; 120 + sdr_cap_buf->vb.vb2_buf.timestamp = 121 + ktime_get_ns() + dev->time_wrap_offset; 122 122 vb2_buffer_done(&sdr_cap_buf->vb.vb2_buf, dev->dqbuf_error ? 123 123 VB2_BUF_STATE_ERROR : VB2_BUF_STATE_DONE); 124 124 dev->dqbuf_error = false;
+2 -4
drivers/media/platform/vivid/vivid-vbi-cap.c
··· 108 108 if (!VIVID_INVALID_SIGNAL(dev->std_signal_mode)) 109 109 vivid_vbi_gen_raw(&dev->vbi_gen, &vbi, vbuf); 110 110 111 - v4l2_get_timestamp(&buf->vb.timestamp); 112 - buf->vb.timestamp.tv_sec += dev->time_wrap_offset; 111 + buf->vb.vb2_buf.timestamp = ktime_get_ns() + dev->time_wrap_offset; 113 112 } 114 113 115 114 ··· 132 133 vbuf[i] = dev->vbi_gen.data[i]; 133 134 } 134 135 135 - v4l2_get_timestamp(&buf->vb.timestamp); 136 - buf->vb.timestamp.tv_sec += dev->time_wrap_offset; 136 + buf->vb.vb2_buf.timestamp = ktime_get_ns() + dev->time_wrap_offset; 137 137 } 138 138 139 139 static int vbi_cap_queue_setup(struct vb2_queue *vq,
+1 -1
drivers/media/platform/vsp1/vsp1_video.c
··· 582 582 spin_unlock_irqrestore(&video->irqlock, flags); 583 583 584 584 done->buf.sequence = video->sequence++; 585 - v4l2_get_timestamp(&done->buf.timestamp); 585 + done->buf.vb2_buf.timestamp = ktime_get_ns(); 586 586 for (i = 0; i < done->buf.vb2_buf.num_planes; ++i) 587 587 vb2_set_plane_payload(&done->buf.vb2_buf, i, done->length[i]); 588 588 vb2_buffer_done(&done->buf.vb2_buf, VB2_BUF_STATE_DONE);
+1 -1
drivers/media/platform/xilinx/xilinx-dma.c
··· 303 303 304 304 buf->buf.field = V4L2_FIELD_NONE; 305 305 buf->buf.sequence = dma->sequence++; 306 - v4l2_get_timestamp(&buf->buf.timestamp); 306 + buf->buf.vb2_buf.timestamp = ktime_get_ns(); 307 307 vb2_set_plane_payload(&buf->buf.vb2_buf, 0, dma->format.sizeimage); 308 308 vb2_buffer_done(&buf->buf.vb2_buf, VB2_BUF_STATE_DONE); 309 309 }
+1 -1
drivers/media/usb/airspy/airspy.c
··· 316 316 len = airspy_convert_stream(s, ptr, urb->transfer_buffer, 317 317 urb->actual_length); 318 318 vb2_set_plane_payload(&fbuf->vb.vb2_buf, 0, len); 319 - v4l2_get_timestamp(&fbuf->vb.timestamp); 319 + fbuf->vb.vb2_buf.timestamp = ktime_get_ns(); 320 320 fbuf->vb.sequence = s->sequence++; 321 321 vb2_buffer_done(&fbuf->vb.vb2_buf, VB2_BUF_STATE_DONE); 322 322 }
+1 -1
drivers/media/usb/au0828/au0828-video.c
··· 314 314 vb->sequence = dev->vbi_frame_count++; 315 315 316 316 vb->field = V4L2_FIELD_INTERLACED; 317 - v4l2_get_timestamp(&vb->timestamp); 317 + vb->vb2_buf.timestamp = ktime_get_ns(); 318 318 vb2_buffer_done(&vb->vb2_buf, VB2_BUF_STATE_DONE); 319 319 } 320 320
+1 -1
drivers/media/usb/em28xx/em28xx-video.c
··· 438 438 buf->vb.field = V4L2_FIELD_NONE; 439 439 else 440 440 buf->vb.field = V4L2_FIELD_INTERLACED; 441 - v4l2_get_timestamp(&buf->vb.timestamp); 441 + buf->vb.vb2_buf.timestamp = ktime_get_ns(); 442 442 443 443 vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE); 444 444 }
+1 -1
drivers/media/usb/go7007/go7007-driver.c
··· 466 466 else 467 467 go7007_set_motion_regions(go, vb, 0); 468 468 469 - v4l2_get_timestamp(&vb->vb.timestamp); 469 + vb->vb.vb2_buf.timestamp = ktime_get_ns(); 470 470 vb_tmp = vb; 471 471 spin_lock(&go->spinlock); 472 472 list_del(&vb->list);
+2 -2
drivers/media/usb/hackrf/hackrf.c
··· 517 517 urb->transfer_buffer, len); 518 518 vb2_set_plane_payload(&buffer->vb.vb2_buf, 0, len); 519 519 buffer->vb.sequence = dev->sequence++; 520 - v4l2_get_timestamp(&buffer->vb.timestamp); 520 + buffer->vb.vb2_buf.timestamp = ktime_get_ns(); 521 521 vb2_buffer_done(&buffer->vb.vb2_buf, VB2_BUF_STATE_DONE); 522 522 exit_usb_submit_urb: 523 523 usb_submit_urb(urb, GFP_ATOMIC); ··· 562 562 vb2_plane_vaddr(&buffer->vb.vb2_buf, 0), len); 563 563 urb->actual_length = len; 564 564 buffer->vb.sequence = dev->sequence++; 565 - v4l2_get_timestamp(&buffer->vb.timestamp); 565 + buffer->vb.vb2_buf.timestamp = ktime_get_ns(); 566 566 vb2_buffer_done(&buffer->vb.vb2_buf, VB2_BUF_STATE_DONE); 567 567 exit_usb_submit_urb: 568 568 usb_submit_urb(urb, GFP_ATOMIC);
+1 -2
drivers/media/usb/pwc/pwc-if.c
··· 316 316 struct pwc_frame_buf *fbuf = pdev->fill_buf; 317 317 318 318 if (pdev->vsync == 1) { 319 - v4l2_get_timestamp( 320 - &fbuf->vb.timestamp); 319 + fbuf->vb.vb2_buf.timestamp = ktime_get_ns(); 321 320 pdev->vsync = 2; 322 321 } 323 322
+1 -1
drivers/media/usb/s2255/s2255drv.c
··· 574 574 buf = list_entry(vc->buf_list.next, 575 575 struct s2255_buffer, list); 576 576 list_del(&buf->list); 577 - v4l2_get_timestamp(&buf->vb.timestamp); 577 + buf->vb.vb2_buf.timestamp = ktime_get_ns(); 578 578 buf->vb.field = vc->field; 579 579 buf->vb.sequence = vc->frame_count; 580 580 spin_unlock_irqrestore(&vc->qlock, flags);
+1 -1
drivers/media/usb/stk1160/stk1160-video.c
··· 99 99 buf->vb.sequence = dev->sequence++; 100 100 buf->vb.field = V4L2_FIELD_INTERLACED; 101 101 buf->vb.vb2_buf.planes[0].bytesused = buf->bytesused; 102 - v4l2_get_timestamp(&buf->vb.timestamp); 102 + buf->vb.vb2_buf.timestamp = ktime_get_ns(); 103 103 104 104 vb2_set_plane_payload(&buf->vb.vb2_buf, 0, buf->bytesused); 105 105 vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
+1 -1
drivers/media/usb/usbtv/usbtv-video.c
··· 322 322 323 323 buf->vb.field = V4L2_FIELD_INTERLACED; 324 324 buf->vb.sequence = usbtv->sequence++; 325 - v4l2_get_timestamp(&buf->vb.timestamp); 325 + buf->vb.vb2_buf.timestamp = ktime_get_ns(); 326 326 vb2_set_plane_payload(&buf->vb.vb2_buf, 0, size); 327 327 vb2_buffer_done(&buf->vb.vb2_buf, state); 328 328 list_del(&buf->list);
+5 -10
drivers/media/usb/uvc/uvc_video.c
··· 694 694 ts.tv_nsec -= NSEC_PER_SEC; 695 695 } 696 696 697 - uvc_trace(UVC_TRACE_CLOCK, "%s: SOF %u.%06llu y %llu ts %lu.%06lu " 698 - "buf ts %lu.%06lu (x1 %u/%u/%u x2 %u/%u/%u y1 %u y2 %u)\n", 697 + uvc_trace(UVC_TRACE_CLOCK, "%s: SOF %u.%06llu y %llu ts %llu " 698 + "buf ts %llu (x1 %u/%u/%u x2 %u/%u/%u y1 %u y2 %u)\n", 699 699 stream->dev->name, 700 700 sof >> 16, div_u64(((u64)sof & 0xffff) * 1000000LLU, 65536), 701 - y, ts.tv_sec, ts.tv_nsec / NSEC_PER_USEC, 702 - vbuf->timestamp.tv_sec, 703 - (unsigned long)vbuf->timestamp.tv_usec, 701 + y, timespec_to_ns(&ts), vbuf->vb2_buf.timestamp, 704 702 x1, first->host_sof, first->dev_sof, 705 703 x2, last->host_sof, last->dev_sof, y1, y2); 706 704 707 705 /* Update the V4L2 buffer. */ 708 - vbuf->timestamp.tv_sec = ts.tv_sec; 709 - vbuf->timestamp.tv_usec = ts.tv_nsec / NSEC_PER_USEC; 706 + vbuf->vb2_buf.timestamp = timespec_to_ns(&ts); 710 707 711 708 done: 712 709 spin_unlock_irqrestore(&stream->clock.lock, flags); ··· 1031 1034 1032 1035 buf->buf.field = V4L2_FIELD_NONE; 1033 1036 buf->buf.sequence = stream->sequence; 1034 - buf->buf.timestamp.tv_sec = ts.tv_sec; 1035 - buf->buf.timestamp.tv_usec = 1036 - ts.tv_nsec / NSEC_PER_USEC; 1037 + buf->buf.vb2_buf.timestamp = timespec_to_ns(&ts); 1037 1038 1038 1039 /* TODO: Handle PTS and SCR. */ 1039 1040 buf->state = UVC_BUF_STATE_ACTIVE;
+3 -4
drivers/media/v4l2-core/videobuf2-v4l2.c
··· 120 120 */ 121 121 if ((q->timestamp_flags & V4L2_BUF_FLAG_TIMESTAMP_MASK) == 122 122 V4L2_BUF_FLAG_TIMESTAMP_COPY) 123 - vbuf->timestamp = b->timestamp; 123 + vb->timestamp = timeval_to_ns(&b->timestamp); 124 124 vbuf->flags |= b->flags & V4L2_BUF_FLAG_TIMECODE; 125 125 if (b->flags & V4L2_BUF_FLAG_TIMECODE) 126 126 vbuf->timecode = b->timecode; ··· 191 191 192 192 b->flags = vbuf->flags; 193 193 b->field = vbuf->field; 194 - b->timestamp = vbuf->timestamp; 194 + b->timestamp = ns_to_timeval(vb->timestamp); 195 195 b->timecode = vbuf->timecode; 196 196 b->sequence = vbuf->sequence; 197 197 b->reserved2 = 0; ··· 308 308 "for an output buffer\n"); 309 309 return -EINVAL; 310 310 } 311 - vbuf->timestamp.tv_sec = 0; 312 - vbuf->timestamp.tv_usec = 0; 311 + vb->timestamp = 0; 313 312 vbuf->sequence = 0; 314 313 315 314 if (V4L2_TYPE_IS_MULTIPLANAR(b->type)) {
+1 -1
drivers/staging/media/davinci_vpfe/vpfe_video.c
··· 470 470 { 471 471 struct vpfe_pipeline *pipe = &video->pipe; 472 472 473 - v4l2_get_timestamp(&video->cur_frm->vb.timestamp); 473 + video->cur_frm->vb.vb2_buf.timestamp = ktime_get_ns(); 474 474 vb2_buffer_done(&video->cur_frm->vb.vb2_buf, VB2_BUF_STATE_DONE); 475 475 if (pipe->state == VPFE_PIPELINE_STREAM_CONTINUOUS) 476 476 video->cur_frm = video->next_frm;
+1 -1
drivers/staging/media/omap4iss/iss_video.c
··· 433 433 list_del(&buf->list); 434 434 spin_unlock_irqrestore(&video->qlock, flags); 435 435 436 - v4l2_get_timestamp(&buf->vb.timestamp); 436 + buf->vb.vb2_buf.timestamp = ktime_get_ns(); 437 437 438 438 /* Do frame number propagation only if this is the output video node. 439 439 * Frame number either comes from the CSI receivers or it gets
+1 -1
drivers/usb/gadget/function/uvc_queue.c
··· 329 329 330 330 buf->buf.field = V4L2_FIELD_NONE; 331 331 buf->buf.sequence = queue->sequence++; 332 - v4l2_get_timestamp(&buf->buf.timestamp); 332 + buf->buf.vb2_buf.timestamp = ktime_get_ns(); 333 333 334 334 vb2_set_plane_payload(&buf->buf.vb2_buf, 0, buf->bytesused); 335 335 vb2_buffer_done(&buf->buf.vb2_buf, VB2_BUF_STATE_DONE);
+2
include/media/videobuf2-core.h
··· 211 211 * @num_planes: number of planes in the buffer 212 212 * on an internal driver queue 213 213 * @planes: private per-plane information; do not change 214 + * @timestamp: frame timestamp in ns 214 215 */ 215 216 struct vb2_buffer { 216 217 struct vb2_queue *vb2_queue; ··· 220 219 unsigned int memory; 221 220 unsigned int num_planes; 222 221 struct vb2_plane planes[VB2_MAX_PLANES]; 222 + u64 timestamp; 223 223 224 224 /* private: internal use only 225 225 *
-2
include/media/videobuf2-v4l2.h
··· 28 28 * @vb2_buf: video buffer 2 29 29 * @flags: buffer informational flags 30 30 * @field: enum v4l2_field; field order of the image in the buffer 31 - * @timestamp: frame timestamp 32 31 * @timecode: frame timecode 33 32 * @sequence: sequence count of this frame 34 33 * Should contain enough information to be able to cover all the fields ··· 38 39 39 40 __u32 flags; 40 41 __u32 field; 41 - struct timeval timestamp; 42 42 struct v4l2_timecode timecode; 43 43 __u32 sequence; 44 44 };
+2 -2
include/trace/events/v4l2.h
··· 184 184 __field(int, minor) 185 185 __field(u32, flags) 186 186 __field(u32, field) 187 - __field(s64, timestamp) 187 + __field(u64, timestamp) 188 188 __field(u32, timecode_type) 189 189 __field(u32, timecode_flags) 190 190 __field(u8, timecode_frames) ··· 205 205 __entry->minor = owner ? owner->vdev->minor : -1; 206 206 __entry->flags = vbuf->flags; 207 207 __entry->field = vbuf->field; 208 - __entry->timestamp = timeval_to_ns(&vbuf->timestamp); 208 + __entry->timestamp = vb->timestamp; 209 209 __entry->timecode_type = vbuf->timecode.type; 210 210 __entry->timecode_flags = vbuf->timecode.flags; 211 211 __entry->timecode_frames = vbuf->timecode.frames;
+5 -2
include/trace/events/vb2.h
··· 18 18 __field(u32, index) 19 19 __field(u32, type) 20 20 __field(u32, bytesused) 21 + __field(u64, timestamp) 21 22 ), 22 23 23 24 TP_fast_assign( ··· 29 28 __entry->index = vb->index; 30 29 __entry->type = vb->type; 31 30 __entry->bytesused = vb->planes[0].bytesused; 31 + __entry->timestamp = vb->timestamp; 32 32 ), 33 33 34 34 TP_printk("owner = %p, queued = %u, owned_by_drv = %d, index = %u, " 35 - "type = %u, bytesused = %u", __entry->owner, 35 + "type = %u, bytesused = %u, timestamp = %llu", __entry->owner, 36 36 __entry->queued_count, 37 37 __entry->owned_by_drv_count, 38 38 __entry->index, __entry->type, 39 - __entry->bytesused 39 + __entry->bytesused, 40 + __entry->timestamp 40 41 ) 41 42 ) 42 43