Skip to content

Commit 4cb9cd8

Browse files
cazouHans Verkuil
authored andcommitted
media: visl: Add HEVC short and long term RPS sets
Log the recently added v4l2 controls to set HEVC short and long term RPS sets with 2 new ftrace entries. Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
1 parent fa05705 commit 4cb9cd8

3 files changed

Lines changed: 69 additions & 0 deletions

File tree

drivers/media/test-drivers/visl/visl-dec.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,9 @@ static void visl_trace_ctrls(struct visl_ctx *ctx, struct visl_run *run)
547547
trace_v4l2_hevc_dpb_entry(&run->hevc.dpram->dpb[i]);
548548

549549
trace_v4l2_hevc_pred_weight_table(&run->hevc.spram->pred_weight_table);
550+
trace_v4l2_ctrl_hevc_ext_sps_lt_rps(run->hevc.rps_lt);
551+
trace_v4l2_ctrl_hevc_ext_sps_st_rps(run->hevc.rps_st);
552+
550553
break;
551554
case VISL_CODEC_AV1:
552555
trace_v4l2_ctrl_av1_sequence(run->av1.seq);
@@ -611,6 +614,10 @@ void visl_device_run(void *priv)
611614
run.hevc.spram = visl_find_control_data(ctx, V4L2_CID_STATELESS_HEVC_SLICE_PARAMS);
612615
run.hevc.sm = visl_find_control_data(ctx, V4L2_CID_STATELESS_HEVC_SCALING_MATRIX);
613616
run.hevc.dpram = visl_find_control_data(ctx, V4L2_CID_STATELESS_HEVC_DECODE_PARAMS);
617+
run.hevc.rps_lt = visl_find_control_data(ctx,
618+
V4L2_CID_STATELESS_HEVC_EXT_SPS_LT_RPS);
619+
run.hevc.rps_st = visl_find_control_data(ctx,
620+
V4L2_CID_STATELESS_HEVC_EXT_SPS_ST_RPS);
614621
break;
615622
case VISL_CODEC_AV1:
616623
run.av1.seq = visl_find_control_data(ctx, V4L2_CID_STATELESS_AV1_SEQUENCE);

drivers/media/test-drivers/visl/visl-dec.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#ifndef _VISL_DEC_H_
88
#define _VISL_DEC_H_
99

10+
#include "linux/v4l2-controls.h"
1011
#include "visl.h"
1112

1213
struct visl_fwht_run {
@@ -43,6 +44,8 @@ struct visl_hevc_run {
4344
const struct v4l2_ctrl_hevc_slice_params *spram;
4445
const struct v4l2_ctrl_hevc_scaling_matrix *sm;
4546
const struct v4l2_ctrl_hevc_decode_params *dpram;
47+
const struct v4l2_ctrl_hevc_ext_sps_lt_rps *rps_lt;
48+
const struct v4l2_ctrl_hevc_ext_sps_st_rps *rps_st;
4649
};
4750

4851
struct visl_av1_run {

drivers/media/test-drivers/visl/visl-trace-hevc.h

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* SPDX-License-Identifier: GPL-2.0+ */
2+
#include "linux/v4l2-controls.h"
23
#if !defined(_VISL_TRACE_HEVC_H_) || defined(TRACE_HEADER_MULTI_READ)
34
#define _VISL_TRACE_HEVC_H_
45

@@ -343,6 +344,54 @@ DECLARE_EVENT_CLASS(v4l2_ctrl_hevc_decode_params_tmpl,
343344
))
344345
);
345346

347+
DECLARE_EVENT_CLASS(v4l2_ctrl_hevc_ext_sps_lt_rps_tmpl,
348+
TP_PROTO(const struct v4l2_ctrl_hevc_ext_sps_lt_rps *lt),
349+
TP_ARGS(lt),
350+
TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_hevc_ext_sps_lt_rps, lt)),
351+
TP_fast_assign(__entry->lt = *lt),
352+
TP_printk("\nflags %s\n"
353+
"lt_ref_pic_poc_lsb_sps %x\n",
354+
__print_flags(__entry->lt.flags, "|",
355+
{V4L2_HEVC_EXT_SPS_LT_RPS_FLAG_USED_LT, "USED_LT"}
356+
),
357+
__entry->lt.lt_ref_pic_poc_lsb_sps
358+
)
359+
)
360+
361+
DECLARE_EVENT_CLASS(v4l2_ctrl_hevc_ext_sps_st_rps_tmpl,
362+
TP_PROTO(const struct v4l2_ctrl_hevc_ext_sps_st_rps *st),
363+
TP_ARGS(st),
364+
TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_hevc_ext_sps_st_rps, st)),
365+
TP_fast_assign(__entry->st = *st),
366+
TP_printk("\nflags %s\n"
367+
"delta_idx_minus1: %u\n"
368+
"delta_rps_sign: %u\n"
369+
"abs_delta_rps_minus1: %u\n"
370+
"num_negative_pics: %u\n"
371+
"num_positive_pics: %u\n"
372+
"used_by_curr_pic: %08x\n"
373+
"use_delta_flag: %08x\n"
374+
"delta_poc_s0_minus1: %s\n"
375+
"delta_poc_s1_minus1: %s\n",
376+
__print_flags(__entry->st.flags, "|",
377+
{V4L2_HEVC_EXT_SPS_ST_RPS_FLAG_INTER_REF_PIC_SET_PRED, "INTER_REF_PIC_SET_PRED"}
378+
),
379+
__entry->st.delta_idx_minus1,
380+
__entry->st.delta_rps_sign,
381+
__entry->st.abs_delta_rps_minus1,
382+
__entry->st.num_negative_pics,
383+
__entry->st.num_positive_pics,
384+
__entry->st.used_by_curr_pic,
385+
__entry->st.use_delta_flag,
386+
__print_array(__entry->st.delta_poc_s0_minus1,
387+
ARRAY_SIZE(__entry->st.delta_poc_s0_minus1),
388+
sizeof(__entry->st.delta_poc_s0_minus1[0])),
389+
__print_array(__entry->st.delta_poc_s1_minus1,
390+
ARRAY_SIZE(__entry->st.delta_poc_s1_minus1),
391+
sizeof(__entry->st.delta_poc_s1_minus1[0]))
392+
)
393+
)
394+
346395

347396
DECLARE_EVENT_CLASS(v4l2_hevc_dpb_entry_tmpl,
348397
TP_PROTO(const struct v4l2_hevc_dpb_entry *e),
@@ -391,6 +440,16 @@ DEFINE_EVENT(v4l2_ctrl_hevc_decode_params_tmpl, v4l2_ctrl_hevc_decode_params,
391440
TP_ARGS(d)
392441
);
393442

443+
DEFINE_EVENT(v4l2_ctrl_hevc_ext_sps_lt_rps_tmpl, v4l2_ctrl_hevc_ext_sps_lt_rps,
444+
TP_PROTO(const struct v4l2_ctrl_hevc_ext_sps_lt_rps *lt),
445+
TP_ARGS(lt)
446+
);
447+
448+
DEFINE_EVENT(v4l2_ctrl_hevc_ext_sps_st_rps_tmpl, v4l2_ctrl_hevc_ext_sps_st_rps,
449+
TP_PROTO(const struct v4l2_ctrl_hevc_ext_sps_st_rps *st),
450+
TP_ARGS(st)
451+
);
452+
394453
DEFINE_EVENT(v4l2_hevc_dpb_entry_tmpl, v4l2_hevc_dpb_entry,
395454
TP_PROTO(const struct v4l2_hevc_dpb_entry *e),
396455
TP_ARGS(e)

0 commit comments

Comments
 (0)