Browse Source

video: driver: convert ts scale before calculating auto framerate

Convert the vb2 timestamp, which is in nanosec scale to microsec
scale before calculating the auto framerate.
Auto framerate calculation requires timestamp values in microsec
to calculate the framerate correctly. Due to wrong timestamp scale,
framerate of 0 was getting set to FW

Change-Id: I49b8ae5cfb2ee89dd283f07a2643238989d43d0a
Signed-off-by: Shrikara B <[email protected]>
Shrikara B 3 years ago
parent
commit
b2d8ec9191
1 changed files with 1 additions and 1 deletions
  1. 1 1
      driver/vidc/src/msm_vidc_vb2.c

+ 1 - 1
driver/vidc/src/msm_vidc_vb2.c

@@ -407,7 +407,7 @@ void msm_vidc_buf_queue(struct vb2_buffer *vb2)
 	}
 
 	if (is_encode_session(inst) && vb2->type == INPUT_MPLANE) {
-		timestamp_us = vb2->timestamp;
+		timestamp_us = div_u64(vb2->timestamp, 1000);
 		msm_vidc_set_auto_framerate(inst, timestamp_us);
 	}
 	inst->last_qbuf_time_ns = ktime_get_ns();