| .. | .. |
|---|
| 1150 | 1150 | if (!ret) { |
|---|
| 1151 | 1151 | denominator = sensor->fi.interval.denominator; |
|---|
| 1152 | 1152 | numerator = sensor->fi.interval.numerator; |
|---|
| 1153 | | - time = numerator * 1000 / denominator * 1000 * 1000; |
|---|
| 1153 | + if (denominator) |
|---|
| 1154 | + time = numerator * 1000 / denominator * 1000 * 1000; |
|---|
| 1154 | 1155 | if (numerator) |
|---|
| 1155 | 1156 | fps = denominator / numerator; |
|---|
| 1156 | 1157 | } |
|---|
| .. | .. |
|---|
| 1225 | 1226 | struct vb2_buffer *vb2_buf = &stream->curr_buf->vb.vb2_buf; |
|---|
| 1226 | 1227 | u64 ns = 0; |
|---|
| 1227 | 1228 | |
|---|
| 1229 | + if (stream->skip_frame) { |
|---|
| 1230 | + spin_lock_irqsave(&stream->vbq_lock, lock_flags); |
|---|
| 1231 | + list_add_tail(&stream->curr_buf->queue, &stream->buf_queue); |
|---|
| 1232 | + spin_unlock_irqrestore(&stream->vbq_lock, lock_flags); |
|---|
| 1233 | + if (stream->skip_frame) |
|---|
| 1234 | + stream->skip_frame--; |
|---|
| 1235 | + goto end; |
|---|
| 1236 | + } |
|---|
| 1237 | + |
|---|
| 1228 | 1238 | /* Dequeue a filled buffer */ |
|---|
| 1229 | 1239 | for (i = 0; i < isp_fmt->mplanes; i++) { |
|---|
| 1230 | 1240 | u32 payload_size = |
|---|
| .. | .. |
|---|
| 1241 | 1251 | atomic_read(&stream->sequence) - 1; |
|---|
| 1242 | 1252 | } |
|---|
| 1243 | 1253 | if (!ns) |
|---|
| 1244 | | - ns = ktime_get_ns(); |
|---|
| 1254 | + ns = rkisp_time_get_ns(dev); |
|---|
| 1245 | 1255 | vb2_buf->timestamp = ns; |
|---|
| 1246 | 1256 | |
|---|
| 1247 | | - ns = ktime_get_ns(); |
|---|
| 1257 | + ns = rkisp_time_get_ns(dev); |
|---|
| 1248 | 1258 | stream->dbg.interval = ns - stream->dbg.timestamp; |
|---|
| 1249 | 1259 | stream->dbg.timestamp = ns; |
|---|
| 1250 | 1260 | stream->dbg.id = stream->curr_buf->vb.sequence; |
|---|
| .. | .. |
|---|
| 1287 | 1297 | stream->curr_buf = NULL; |
|---|
| 1288 | 1298 | } |
|---|
| 1289 | 1299 | |
|---|
| 1300 | +end: |
|---|
| 1290 | 1301 | if (!interlaced || |
|---|
| 1291 | 1302 | (stream->curr_buf == stream->next_buf && |
|---|
| 1292 | 1303 | stream->u.sp.field == RKISP_FIELD_ODD)) { |
|---|
| .. | .. |
|---|
| 1505 | 1516 | if (stream->id == RKISP_STREAM_MP || stream->id == RKISP_STREAM_SP) |
|---|
| 1506 | 1517 | hdr_config_dmatx(dev); |
|---|
| 1507 | 1518 | stream->streaming = true; |
|---|
| 1508 | | - |
|---|
| 1519 | + stream->skip_frame = 0; |
|---|
| 1509 | 1520 | return 0; |
|---|
| 1510 | 1521 | } |
|---|
| 1511 | 1522 | |
|---|