Re: [PATCH 4/6] venus: venc: Add support for frame-skip mode v4l2 control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Stanimir,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on linux/master soc/for-next linus/master v5.8-rc6 next-20200720]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Stanimir-Varbanov/Add-new-controls-for-CQ-and-Frame-skip/20200720-212608
base:   git://linuxtv.org/media_tree.git master
config: sparc-allyesconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sparc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   drivers/media/platform/qcom/venus/venc_ctrls.c: In function 'venc_op_s_ctrl':
>> drivers/media/platform/qcom/venus/venc_ctrls.c:206:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
     206 |   ctr->const_quality = ctrl->val;
         |   ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
   drivers/media/platform/qcom/venus/venc_ctrls.c:207:2: note: here
     207 |  case V4L2_CID_MPEG_VIDEO_FRAME_SKIP_MODE:
         |  ^~~~

vim +206 drivers/media/platform/qcom/venus/venc_ctrls.c

8fc58186bb41ff Stanimir Varbanov 2017-12-01   68  
aaaa93eda64b00 Stanimir Varbanov 2017-06-15   69  static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl)
aaaa93eda64b00 Stanimir Varbanov 2017-06-15   70  {
aaaa93eda64b00 Stanimir Varbanov 2017-06-15   71  	struct venus_inst *inst = ctrl_to_inst(ctrl);
aaaa93eda64b00 Stanimir Varbanov 2017-06-15   72  	struct venc_controls *ctr = &inst->controls.enc;
c35f0b16537c15 Malathi Gottam    2018-11-02   73  	struct hfi_enable en = { .enable = 1 };
61df5aa325fec4 Malathi Gottam    2018-11-02   74  	struct hfi_bitrate brate;
8fc58186bb41ff Stanimir Varbanov 2017-12-01   75  	u32 bframes;
61df5aa325fec4 Malathi Gottam    2018-11-02   76  	u32 ptype;
8fc58186bb41ff Stanimir Varbanov 2017-12-01   77  	int ret;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15   78  
aaaa93eda64b00 Stanimir Varbanov 2017-06-15   79  	switch (ctrl->id) {
aaaa93eda64b00 Stanimir Varbanov 2017-06-15   80  	case V4L2_CID_MPEG_VIDEO_BITRATE_MODE:
aaaa93eda64b00 Stanimir Varbanov 2017-06-15   81  		ctr->bitrate_mode = ctrl->val;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15   82  		break;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15   83  	case V4L2_CID_MPEG_VIDEO_BITRATE:
aaaa93eda64b00 Stanimir Varbanov 2017-06-15   84  		ctr->bitrate = ctrl->val;
61df5aa325fec4 Malathi Gottam    2018-11-02   85  		mutex_lock(&inst->lock);
61df5aa325fec4 Malathi Gottam    2018-11-02   86  		if (inst->streamon_out && inst->streamon_cap) {
61df5aa325fec4 Malathi Gottam    2018-11-02   87  			ptype = HFI_PROPERTY_CONFIG_VENC_TARGET_BITRATE;
61df5aa325fec4 Malathi Gottam    2018-11-02   88  			brate.bitrate = ctr->bitrate;
61df5aa325fec4 Malathi Gottam    2018-11-02   89  			brate.layer_id = 0;
61df5aa325fec4 Malathi Gottam    2018-11-02   90  
61df5aa325fec4 Malathi Gottam    2018-11-02   91  			ret = hfi_session_set_property(inst, ptype, &brate);
61df5aa325fec4 Malathi Gottam    2018-11-02   92  			if (ret) {
61df5aa325fec4 Malathi Gottam    2018-11-02   93  				mutex_unlock(&inst->lock);
61df5aa325fec4 Malathi Gottam    2018-11-02   94  				return ret;
61df5aa325fec4 Malathi Gottam    2018-11-02   95  			}
61df5aa325fec4 Malathi Gottam    2018-11-02   96  		}
61df5aa325fec4 Malathi Gottam    2018-11-02   97  		mutex_unlock(&inst->lock);
aaaa93eda64b00 Stanimir Varbanov 2017-06-15   98  		break;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15   99  	case V4L2_CID_MPEG_VIDEO_BITRATE_PEAK:
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  100  		ctr->bitrate_peak = ctrl->val;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  101  		break;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  102  	case V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE:
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  103  		ctr->h264_entropy_mode = ctrl->val;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  104  		break;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  105  	case V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE:
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  106  		ctr->profile.mpeg4 = ctrl->val;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  107  		break;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  108  	case V4L2_CID_MPEG_VIDEO_H264_PROFILE:
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  109  		ctr->profile.h264 = ctrl->val;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  110  		break;
cd396c8cbfcdd7 Kelvin Lawson     2018-12-10  111  	case V4L2_CID_MPEG_VIDEO_HEVC_PROFILE:
cd396c8cbfcdd7 Kelvin Lawson     2018-12-10  112  		ctr->profile.hevc = ctrl->val;
cd396c8cbfcdd7 Kelvin Lawson     2018-12-10  113  		break;
5520b9467a39d5 Keiichi Watanabe  2018-06-18  114  	case V4L2_CID_MPEG_VIDEO_VP8_PROFILE:
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  115  		ctr->profile.vpx = ctrl->val;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  116  		break;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  117  	case V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL:
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  118  		ctr->level.mpeg4 = ctrl->val;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  119  		break;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  120  	case V4L2_CID_MPEG_VIDEO_H264_LEVEL:
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  121  		ctr->level.h264 = ctrl->val;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  122  		break;
cd396c8cbfcdd7 Kelvin Lawson     2018-12-10  123  	case V4L2_CID_MPEG_VIDEO_HEVC_LEVEL:
cd396c8cbfcdd7 Kelvin Lawson     2018-12-10  124  		ctr->level.hevc = ctrl->val;
cd396c8cbfcdd7 Kelvin Lawson     2018-12-10  125  		break;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  126  	case V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP:
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  127  		ctr->h264_i_qp = ctrl->val;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  128  		break;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  129  	case V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP:
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  130  		ctr->h264_p_qp = ctrl->val;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  131  		break;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  132  	case V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP:
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  133  		ctr->h264_b_qp = ctrl->val;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  134  		break;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  135  	case V4L2_CID_MPEG_VIDEO_H264_MIN_QP:
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  136  		ctr->h264_min_qp = ctrl->val;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  137  		break;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  138  	case V4L2_CID_MPEG_VIDEO_H264_MAX_QP:
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  139  		ctr->h264_max_qp = ctrl->val;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  140  		break;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  141  	case V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE:
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  142  		ctr->multi_slice_mode = ctrl->val;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  143  		break;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  144  	case V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES:
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  145  		ctr->multi_slice_max_bytes = ctrl->val;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  146  		break;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  147  	case V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB:
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  148  		ctr->multi_slice_max_mb = ctrl->val;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  149  		break;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  150  	case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA:
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  151  		ctr->h264_loop_filter_alpha = ctrl->val;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  152  		break;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  153  	case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA:
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  154  		ctr->h264_loop_filter_beta = ctrl->val;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  155  		break;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  156  	case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE:
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  157  		ctr->h264_loop_filter_mode = ctrl->val;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  158  		break;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  159  	case V4L2_CID_MPEG_VIDEO_HEADER_MODE:
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  160  		ctr->header_mode = ctrl->val;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  161  		break;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  162  	case V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB:
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  163  		break;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  164  	case V4L2_CID_MPEG_VIDEO_GOP_SIZE:
8fc58186bb41ff Stanimir Varbanov 2017-12-01  165  		ret = venc_calc_bpframes(ctrl->val, ctr->num_b_frames, &bframes,
8fc58186bb41ff Stanimir Varbanov 2017-12-01  166  					 &ctr->num_p_frames);
8fc58186bb41ff Stanimir Varbanov 2017-12-01  167  		if (ret)
8fc58186bb41ff Stanimir Varbanov 2017-12-01  168  			return ret;
8fc58186bb41ff Stanimir Varbanov 2017-12-01  169  
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  170  		ctr->gop_size = ctrl->val;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  171  		break;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  172  	case V4L2_CID_MPEG_VIDEO_H264_I_PERIOD:
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  173  		ctr->h264_i_period = ctrl->val;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  174  		break;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  175  	case V4L2_CID_MPEG_VIDEO_VPX_MIN_QP:
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  176  		ctr->vp8_min_qp = ctrl->val;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  177  		break;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  178  	case V4L2_CID_MPEG_VIDEO_VPX_MAX_QP:
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  179  		ctr->vp8_max_qp = ctrl->val;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  180  		break;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  181  	case V4L2_CID_MPEG_VIDEO_B_FRAMES:
8fc58186bb41ff Stanimir Varbanov 2017-12-01  182  		ret = venc_calc_bpframes(ctr->gop_size, ctrl->val, &bframes,
8fc58186bb41ff Stanimir Varbanov 2017-12-01  183  					 &ctr->num_p_frames);
8fc58186bb41ff Stanimir Varbanov 2017-12-01  184  		if (ret)
8fc58186bb41ff Stanimir Varbanov 2017-12-01  185  			return ret;
8fc58186bb41ff Stanimir Varbanov 2017-12-01  186  
8fc58186bb41ff Stanimir Varbanov 2017-12-01  187  		ctr->num_b_frames = bframes;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  188  		break;
c35f0b16537c15 Malathi Gottam    2018-11-02  189  	case V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME:
c35f0b16537c15 Malathi Gottam    2018-11-02  190  		mutex_lock(&inst->lock);
c35f0b16537c15 Malathi Gottam    2018-11-02  191  		if (inst->streamon_out && inst->streamon_cap) {
c35f0b16537c15 Malathi Gottam    2018-11-02  192  			ptype = HFI_PROPERTY_CONFIG_VENC_REQUEST_SYNC_FRAME;
c35f0b16537c15 Malathi Gottam    2018-11-02  193  			ret = hfi_session_set_property(inst, ptype, &en);
c35f0b16537c15 Malathi Gottam    2018-11-02  194  
c35f0b16537c15 Malathi Gottam    2018-11-02  195  			if (ret) {
c35f0b16537c15 Malathi Gottam    2018-11-02  196  				mutex_unlock(&inst->lock);
c35f0b16537c15 Malathi Gottam    2018-11-02  197  				return ret;
c35f0b16537c15 Malathi Gottam    2018-11-02  198  			}
c35f0b16537c15 Malathi Gottam    2018-11-02  199  		}
c35f0b16537c15 Malathi Gottam    2018-11-02  200  		mutex_unlock(&inst->lock);
c35f0b16537c15 Malathi Gottam    2018-11-02  201  		break;
6f704b2fbbde0c Jeffrey Kardatzke 2020-02-22  202  	case V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE:
6f704b2fbbde0c Jeffrey Kardatzke 2020-02-22  203  		ctr->rc_enable = ctrl->val;
6f704b2fbbde0c Jeffrey Kardatzke 2020-02-22  204  		break;
1b66e2818e6ed3 Stanimir Varbanov 2020-07-20  205  	case V4L2_CID_MPEG_VIDEO_CONSTANT_QUALITY:
1b66e2818e6ed3 Stanimir Varbanov 2020-07-20 @206  		ctr->const_quality = ctrl->val;
0978d8244ce6b2 Stanimir Varbanov 2020-07-20  207  	case V4L2_CID_MPEG_VIDEO_FRAME_SKIP_MODE:
0978d8244ce6b2 Stanimir Varbanov 2020-07-20  208  		ctr->frame_skip_mode = ctrl->val;
1b66e2818e6ed3 Stanimir Varbanov 2020-07-20  209  		break;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  210  	default:
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  211  		return -EINVAL;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  212  	}
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  213  
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  214  	return 0;
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  215  }
aaaa93eda64b00 Stanimir Varbanov 2017-06-15  216  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux