[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <418311dac48d3a29b4fe9e363f7d4e82c360f586.camel@collabora.com>
Date: Fri, 18 Jun 2021 15:58:46 -0300
From: Ezequiel Garcia <ezequiel@...labora.com>
To: Benjamin Gaignard <benjamin.gaignard@...labora.com>,
hverkuil@...all.nl, p.zabel@...gutronix.de, mchehab@...nel.org,
shawnguo@...nel.org, s.hauer@...gutronix.de, festevam@...il.com,
gregkh@...uxfoundation.org, mripard@...nel.org,
paul.kocialkowski@...tlin.com, wens@...e.org,
jernej.skrabec@...l.net, emil.l.velikov@...il.com,
andrzej.p@...labora.com, jc@...esim.co.uk,
jernej.skrabec@...il.com, nicolas@...fresne.ca
Cc: kernel@...gutronix.de, linux-imx@....com,
linux-media@...r.kernel.org, linux-rockchip@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/8] media: hantro: Trace hevc hw cycles performance
register
Hi Benjamin,
On Fri, 2021-06-18 at 15:15 +0200, Benjamin Gaignard wrote:
> After each hevc decoded frame trace the hardware performance.
> It provides the number of hw cycles spend per decoded macroblock.
>
Please add some documentation about how these are supposed
to be used. It will be easier to discuss after seeing
things in actiion.
A good place for the documentation would be:
https://www.kernel.org/doc/html/latest/admin-guide/media/v4l-drivers.html
[..]
> @@ -22,6 +23,21 @@ static inline void hantro_write_addr(struct hantro_dev *vpu,
> vdpu_write(vpu, addr & 0xffffffff, offset);
> }
>
> +void hantro_g2_hevc_dec_done(struct hantro_ctx *ctx)
I'm worried about the runtime cost this would have.
I see other drivers (i915, panfrost) seem to have an ioctl
to enable the perf counters.
Perhaps we don't need an ioctl, but a module param would be enough
for now.
> +{
> + const struct hantro_hevc_dec_ctrls *ctrls = &ctx->hevc_dec.ctrls;
> + const struct v4l2_ctrl_hevc_sps *sps = ctrls->sps;
> + struct hantro_dev *vpu = ctx->dev;
> + u32 hw_cycles = 0;
> + u32 mbs = (sps->pic_width_in_luma_samples *
> + sps->pic_height_in_luma_samples) >> 8;
> +
> + if (mbs)
> + hw_cycles = vdpu_read(vpu, G2_HW_PERFORMANCE) / mbs;
> +
> + trace_hantro_hevc_perf(ctx, hw_cycles);
> +}
> +
>
[..]
> +
> +TRACE_EVENT(hantro_hevc_perf,
> + TP_PROTO(struct hantro_ctx *ctx, u32 hw_cycles),
> +
> + TP_ARGS(ctx, hw_cycles),
> +
> + TP_STRUCT__entry(
> + __field(int, minor)
> + __field(u32, hw_cycles)
> + ),
> +
> + TP_fast_assign(
> + __entry->minor = ctx->fh.vdev->minor;
Tracking performance per minor doesn't seem useful,
we'd like to track per-fd (i.e. per context).
Thanks,
Ezequiel
Powered by blists - more mailing lists