linux/drivers/media/platform/qcom/venus/helpers.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: GPL-2.0-only */
   2/*
   3 * Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
   4 * Copyright (C) 2017 Linaro Ltd.
   5 */
   6#ifndef __VENUS_HELPERS_H__
   7#define __VENUS_HELPERS_H__
   8
   9#include <media/videobuf2-v4l2.h>
  10
  11struct venus_inst;
  12struct venus_core;
  13
  14bool venus_helper_check_codec(struct venus_inst *inst, u32 v4l2_pixfmt);
  15struct vb2_v4l2_buffer *venus_helper_find_buf(struct venus_inst *inst,
  16                                              unsigned int type, u32 idx);
  17void venus_helper_buffers_done(struct venus_inst *inst, unsigned int type,
  18                               enum vb2_buffer_state state);
  19int venus_helper_vb2_buf_init(struct vb2_buffer *vb);
  20int venus_helper_vb2_buf_prepare(struct vb2_buffer *vb);
  21void venus_helper_vb2_buf_queue(struct vb2_buffer *vb);
  22void venus_helper_vb2_stop_streaming(struct vb2_queue *q);
  23int venus_helper_vb2_start_streaming(struct venus_inst *inst);
  24void venus_helper_m2m_device_run(void *priv);
  25void venus_helper_m2m_job_abort(void *priv);
  26int venus_helper_get_bufreq(struct venus_inst *inst, u32 type,
  27                            struct hfi_buffer_requirements *req);
  28u32 venus_helper_get_framesz_raw(u32 hfi_fmt, u32 width, u32 height);
  29u32 venus_helper_get_framesz(u32 v4l2_fmt, u32 width, u32 height);
  30int venus_helper_set_input_resolution(struct venus_inst *inst,
  31                                      unsigned int width, unsigned int height);
  32int venus_helper_set_output_resolution(struct venus_inst *inst,
  33                                       unsigned int width, unsigned int height,
  34                                       u32 buftype);
  35int venus_helper_set_work_mode(struct venus_inst *inst);
  36int venus_helper_set_format_constraints(struct venus_inst *inst);
  37int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs,
  38                              unsigned int output_bufs,
  39                              unsigned int output2_bufs);
  40int venus_helper_set_raw_format(struct venus_inst *inst, u32 hfi_format,
  41                                u32 buftype);
  42int venus_helper_set_color_format(struct venus_inst *inst, u32 fmt);
  43int venus_helper_set_dyn_bufmode(struct venus_inst *inst);
  44int venus_helper_set_bufsize(struct venus_inst *inst, u32 bufsize, u32 buftype);
  45int venus_helper_set_multistream(struct venus_inst *inst, bool out_en,
  46                                 bool out2_en);
  47unsigned int venus_helper_get_opb_size(struct venus_inst *inst);
  48void venus_helper_acquire_buf_ref(struct vb2_v4l2_buffer *vbuf);
  49void venus_helper_release_buf_ref(struct venus_inst *inst, unsigned int idx);
  50void venus_helper_init_instance(struct venus_inst *inst);
  51int venus_helper_session_init(struct venus_inst *inst);
  52int venus_helper_get_out_fmts(struct venus_inst *inst, u32 fmt, u32 *out_fmt,
  53                              u32 *out2_fmt, bool ubwc);
  54int venus_helper_alloc_dpb_bufs(struct venus_inst *inst);
  55int venus_helper_free_dpb_bufs(struct venus_inst *inst);
  56int venus_helper_intbufs_alloc(struct venus_inst *inst);
  57int venus_helper_intbufs_free(struct venus_inst *inst);
  58int venus_helper_intbufs_realloc(struct venus_inst *inst);
  59int venus_helper_queue_dpb_bufs(struct venus_inst *inst);
  60int venus_helper_unregister_bufs(struct venus_inst *inst);
  61int venus_helper_process_initial_cap_bufs(struct venus_inst *inst);
  62int venus_helper_process_initial_out_bufs(struct venus_inst *inst);
  63void venus_helper_get_ts_metadata(struct venus_inst *inst, u64 timestamp_us,
  64                                  struct vb2_v4l2_buffer *vbuf);
  65int venus_helper_get_profile_level(struct venus_inst *inst, u32 *profile, u32 *level);
  66int venus_helper_set_profile_level(struct venus_inst *inst, u32 profile, u32 level);
  67int venus_helper_set_stride(struct venus_inst *inst, unsigned int aligned_width,
  68                            unsigned int aligned_height);
  69#endif
  70