[FFmpeg-devel] [PATCH 07/16] hwcontext_nvtegra: add dynamic frequency scaling routines
Mark Thompson
sw at jkqxz.net
Wed Jun 5 23:50:52 EEST 2024
On 30/05/2024 20:43, averne wrote:
> To save on energy, the clock speed of multimedia engines should be adapted to their workload.
>
> Signed-off-by: averne <averne381 at gmail.com>
> ---
> libavutil/hwcontext_nvtegra.c | 165 ++++++++++++++++++++++++++++++++++
> libavutil/hwcontext_nvtegra.h | 7 ++
> 2 files changed, 172 insertions(+)
>
> ...
> diff --git a/libavutil/hwcontext_nvtegra.h b/libavutil/hwcontext_nvtegra.h
> index 8a2383d304..7c845951d9 100644
> --- a/libavutil/hwcontext_nvtegra.h
> +++ b/libavutil/hwcontext_nvtegra.h
> @@ -82,4 +82,11 @@ static inline AVNVTegraMap *av_nvtegra_frame_get_fbuf_map(const AVFrame *frame)
> */
> int av_nvtegra_pixfmt_to_vic(enum AVPixelFormat fmt);
>
> +/*
> + * Dynamic frequency scaling routines
> + */
> +int av_nvtegra_dfs_init(AVHWDeviceContext *ctx, AVNVTegraChannel *channel, int width, int height, double framerate_hz);
> +int av_nvtegra_dfs_update(AVHWDeviceContext *ctx, AVNVTegraChannel *channel, int bitstream_len, int decode_cycles);
> +int av_nvtegra_dfs_uninit(AVHWDeviceContext *ctx, AVNVTegraChannel *channel);
> +
> #endif /* AVUTIL_HWCONTEXT_NVTEGRA_H */
This really isn't a sensible thing to have in the public API of ffmpeg. Why on earth isn't this sort of detail dealt with by the kernel? (Which can actually see all of the different processes using it, as well.)
Thanks,
- Mark
More information about the ffmpeg-devel
mailing list