msm: vidc: revise timestamp data type to s64

Revise internal timestamp data type from u64
to s64 in case of negative timestamps.

Change-Id: Ib026d504a08ce5ac67d1d962b671c37637761321
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
This commit is contained in:
Shi Zhongbo 2020-08-10 13:52:36 +08:00 committed by Gerrit - the friendly Code Review server
parent 460c45b72a
commit b1a132ad57
4 changed files with 7 additions and 7 deletions

View File

@ -366,7 +366,7 @@ int msm_vidc_qbuf(void *instance, struct media_device *mdev,
int rc = 0;
unsigned int i = 0;
struct buf_queue *q = NULL;
u64 timestamp_us = 0;
s64 timestamp_us = 0;
u32 cr = 0;
if (!inst || !inst->core || !b || !valid_v4l2_buffer(b, inst)) {
@ -430,7 +430,7 @@ int msm_vidc_qbuf(void *instance, struct media_device *mdev,
&& b->type == INPUT_MPLANE)
b->flags |= V4L2_BUF_FLAG_PERF_MODE;
timestamp_us = (u64)((b->timestamp.tv_sec * 1000000ULL) +
timestamp_us = (s64)((b->timestamp.tv_sec * 1000000) +
b->timestamp.tv_usec);
if (is_decode_session(inst) && b->type == INPUT_MPLANE) {
if (inst->flush_timestamps)

View File

@ -7600,7 +7600,7 @@ void msm_comm_release_timestamps(struct msm_vidc_inst *inst)
mutex_unlock(&inst->timestamps.lock);
}
int msm_comm_store_timestamp(struct msm_vidc_inst *inst, u64 timestamp_us,
int msm_comm_store_timestamp(struct msm_vidc_inst *inst, s64 timestamp_us,
bool is_eos)
{
struct msm_vidc_timestamps *entry, *node, *prev = NULL;
@ -7794,8 +7794,8 @@ int msm_comm_fetch_ts_framerate(struct msm_vidc_inst *inst,
if (!(b->flags & V4L2_BUF_FLAG_END_OF_SUBFRAME))
node->is_valid = false;
b->timestamp.tv_sec = node->timestamp_us / 1000000ull;
b->timestamp.tv_usec = node->timestamp_us % 1000000ull;
b->timestamp.tv_sec = node->timestamp_us / 1000000;
b->timestamp.tv_usec = node->timestamp_us % 1000000;
b->m.planes[0].reserved[MSM_VIDC_FRAMERATE] = node->framerate;
break;
}

View File

@ -400,7 +400,7 @@ int msm_comm_set_cvp_skip_ratio(struct msm_vidc_inst *inst,
uint32_t capture_rate, uint32_t cvp_rate);
int msm_comm_fetch_ts_framerate(struct msm_vidc_inst *inst,
struct v4l2_buffer *b);
int msm_comm_store_timestamp(struct msm_vidc_inst *inst, u64 timestamp_us,
int msm_comm_store_timestamp(struct msm_vidc_inst *inst, s64 timestamp_us,
bool is_eos);
void msm_comm_release_timestamps(struct msm_vidc_inst *inst);
u32 msm_comm_get_max_framerate(struct msm_vidc_inst *inst);

View File

@ -236,7 +236,7 @@ struct msm_vidc_codec {
struct msm_vidc_timestamps {
struct list_head list;
u64 timestamp_us;
s64 timestamp_us;
u32 framerate;
bool is_valid;
bool is_eos;