s5p_mfc_opr.h 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * drivers/media/platform/s5p-mfc/s5p_mfc_opr.h
  3. *
  4. * Header file for Samsung MFC (Multi Function Codec - FIMV) driver
  5. * Contains declarations of hw related functions.
  6. *
  7. * Kamil Debski, Copyright (C) 2012 Samsung Electronics Co., Ltd.
  8. * http://www.samsung.com/
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2 as
  12. * published by the Free Software Foundation.
  13. */
  14. #ifndef S5P_MFC_OPR_H_
  15. #define S5P_MFC_OPR_H_
  16. #include "s5p_mfc_common.h"
  17. struct s5p_mfc_hw_ops {
  18. int (*alloc_dec_temp_buffers)(struct s5p_mfc_ctx *ctx);
  19. void (*release_dec_desc_buffer)(struct s5p_mfc_ctx *ctx);
  20. int (*alloc_codec_buffers)(struct s5p_mfc_ctx *ctx);
  21. void (*release_codec_buffers)(struct s5p_mfc_ctx *ctx);
  22. int (*alloc_instance_buffer)(struct s5p_mfc_ctx *ctx);
  23. void (*release_instance_buffer)(struct s5p_mfc_ctx *ctx);
  24. int (*alloc_dev_context_buffer)(struct s5p_mfc_dev *dev);
  25. void (*release_dev_context_buffer)(struct s5p_mfc_dev *dev);
  26. void (*dec_calc_dpb_size)(struct s5p_mfc_ctx *ctx);
  27. void (*enc_calc_src_size)(struct s5p_mfc_ctx *ctx);
  28. int (*set_dec_stream_buffer)(struct s5p_mfc_ctx *ctx,
  29. int buf_addr, unsigned int start_num_byte,
  30. unsigned int buf_size);
  31. int (*set_dec_frame_buffer)(struct s5p_mfc_ctx *ctx);
  32. int (*set_enc_stream_buffer)(struct s5p_mfc_ctx *ctx,
  33. unsigned long addr, unsigned int size);
  34. void (*set_enc_frame_buffer)(struct s5p_mfc_ctx *ctx,
  35. unsigned long y_addr, unsigned long c_addr);
  36. void (*get_enc_frame_buffer)(struct s5p_mfc_ctx *ctx,
  37. unsigned long *y_addr, unsigned long *c_addr);
  38. int (*set_enc_ref_buffer)(struct s5p_mfc_ctx *ctx);
  39. int (*init_decode)(struct s5p_mfc_ctx *ctx);
  40. int (*init_encode)(struct s5p_mfc_ctx *ctx);
  41. int (*encode_one_frame)(struct s5p_mfc_ctx *ctx);
  42. void (*try_run)(struct s5p_mfc_dev *dev);
  43. void (*cleanup_queue)(struct list_head *lh,
  44. struct vb2_queue *vq);
  45. void (*clear_int_flags)(struct s5p_mfc_dev *dev);
  46. void (*write_info)(struct s5p_mfc_ctx *ctx, unsigned int data,
  47. unsigned int ofs);
  48. unsigned int (*read_info)(struct s5p_mfc_ctx *ctx,
  49. unsigned int ofs);
  50. int (*get_dspl_y_adr)(struct s5p_mfc_dev *dev);
  51. int (*get_dec_y_adr)(struct s5p_mfc_dev *dev);
  52. int (*get_dspl_status)(struct s5p_mfc_dev *dev);
  53. int (*get_dec_status)(struct s5p_mfc_dev *dev);
  54. int (*get_dec_frame_type)(struct s5p_mfc_dev *dev);
  55. int (*get_disp_frame_type)(struct s5p_mfc_ctx *ctx);
  56. int (*get_consumed_stream)(struct s5p_mfc_dev *dev);
  57. int (*get_int_reason)(struct s5p_mfc_dev *dev);
  58. int (*get_int_err)(struct s5p_mfc_dev *dev);
  59. int (*err_dec)(unsigned int err);
  60. int (*err_dspl)(unsigned int err);
  61. int (*get_img_width)(struct s5p_mfc_dev *dev);
  62. int (*get_img_height)(struct s5p_mfc_dev *dev);
  63. int (*get_dpb_count)(struct s5p_mfc_dev *dev);
  64. int (*get_mv_count)(struct s5p_mfc_dev *dev);
  65. int (*get_inst_no)(struct s5p_mfc_dev *dev);
  66. int (*get_enc_strm_size)(struct s5p_mfc_dev *dev);
  67. int (*get_enc_slice_type)(struct s5p_mfc_dev *dev);
  68. int (*get_enc_dpb_count)(struct s5p_mfc_dev *dev);
  69. int (*get_enc_pic_count)(struct s5p_mfc_dev *dev);
  70. int (*get_sei_avail_status)(struct s5p_mfc_ctx *ctx);
  71. int (*get_mvc_num_views)(struct s5p_mfc_dev *dev);
  72. int (*get_mvc_view_id)(struct s5p_mfc_dev *dev);
  73. unsigned int (*get_pic_type_top)(struct s5p_mfc_ctx *ctx);
  74. unsigned int (*get_pic_type_bot)(struct s5p_mfc_ctx *ctx);
  75. unsigned int (*get_crop_info_h)(struct s5p_mfc_ctx *ctx);
  76. unsigned int (*get_crop_info_v)(struct s5p_mfc_ctx *ctx);
  77. };
  78. void s5p_mfc_init_hw_ops(struct s5p_mfc_dev *dev);
  79. int s5p_mfc_alloc_priv_buf(struct device *dev,
  80. struct s5p_mfc_priv_buf *b);
  81. void s5p_mfc_release_priv_buf(struct device *dev,
  82. struct s5p_mfc_priv_buf *b);
  83. #endif /* S5P_MFC_OPR_H_ */