Re: [linux-sunxi] [PATCH 4/4] media: cedrus: hevc: Add support for multiple slices
Dne sobota, 26. oktober 2019 ob 19:47:03 CET je Jernej Skrabec napisal(a): > Now that segment address is available, support for multi-slice frames > can be easily added. > > Signed-off-by: Jernej Skrabec > --- > .../staging/media/sunxi/cedrus/cedrus_h265.c | 21 +++ > .../staging/media/sunxi/cedrus/cedrus_video.c | 1 + > 2 files changed, 18 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h265.c > b/drivers/staging/media/sunxi/cedrus/cedrus_h265.c index > 888bfd5ca224..e909adf6f30f 100644 > --- a/drivers/staging/media/sunxi/cedrus/cedrus_h265.c > +++ b/drivers/staging/media/sunxi/cedrus/cedrus_h265.c > @@ -366,15 +366,28 @@ static void cedrus_h265_setup(struct cedrus_ctx *ctx, > reg = VE_DEC_H265_BITS_END_ADDR_BASE(src_buf_end_addr); > cedrus_write(dev, VE_DEC_H265_BITS_END_ADDR, reg); > > - /* Coding tree block address: start at the beginning. */ > + /* Coding tree block address */ > reg = VE_DEC_H265_DEC_CTB_ADDR_X(0) | VE_DEC_H265_DEC_CTB_ADDR_Y(0); > + if (!ctx->fh.m2m_ctx->new_frame) { There is no reason why would this block be guarded by above if clause. I'll remove it in next revision. However, it uncovered a bug where new_frame is set to true for every slice. I have to debug this further. At this point I can't say for sure if it is in kernel or in ffmpeg. Best regards, Jernej > + unsigned int log2_max_luma_coding_block_size = > + sps->log2_min_luma_coding_block_size_minus3 + 3 + > + sps->log2_diff_max_min_luma_coding_block_size; > + unsigned int ctb_size_luma = > + 1UL << log2_max_luma_coding_block_size; > + unsigned int width_in_ctb_luma = > + DIV_ROUND_UP(sps->pic_width_in_luma_samples, ctb_size_luma); > + > + reg = VE_DEC_H265_DEC_CTB_ADDR_X(slice_params- >slice_segment_addr % > width_in_ctb_luma); + reg |= > VE_DEC_H265_DEC_CTB_ADDR_Y(slice_params->slice_segment_addr / > width_in_ctb_luma); + } > cedrus_write(dev, VE_DEC_H265_DEC_CTB_ADDR, reg); > > cedrus_write(dev, VE_DEC_H265_TILE_START_CTB, 0); > cedrus_write(dev, VE_DEC_H265_TILE_END_CTB, 0); > > /* Clear the number of correctly-decoded coding tree blocks. */ > - cedrus_write(dev, VE_DEC_H265_DEC_CTB_NUM, 0); > + if (ctx->fh.m2m_ctx->new_frame) > + cedrus_write(dev, VE_DEC_H265_DEC_CTB_NUM, 0); > > /* Initialize bitstream access. */ > cedrus_write(dev, VE_DEC_H265_TRIGGER, VE_DEC_H265_TRIGGER_INIT_SWDEC); > @@ -523,8 +536,8 @@ static void cedrus_h265_setup(struct cedrus_ctx *ctx, > V4L2_HEVC_PPS_FLAG_DEPENDENT_SLICE_SEGMENT, > pps->flags); > > - /* FIXME: For multi-slice support. */ > - reg |= VE_DEC_H265_DEC_SLICE_HDR_INFO0_FLAG_FIRST_SLICE_SEGMENT_IN_PIC; > + if (ctx->fh.m2m_ctx->new_frame) > + reg |= VE_DEC_H265_DEC_SLICE_HDR_INFO0_FLAG_FIRST_SLICE_SEGMENT_IN_PIC; > > cedrus_write(dev, VE_DEC_H265_DEC_SLICE_HDR_INFO0, reg); > > diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c > b/drivers/staging/media/sunxi/cedrus/cedrus_video.c index > 15cf1f10221b..497b1199d3fe 100644 > --- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c > +++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c > @@ -311,6 +311,7 @@ static int cedrus_s_fmt_vid_out(struct file *file, void > *priv, > > switch (ctx->src_fmt.pixelformat) { > case V4L2_PIX_FMT_H264_SLICE: > + case V4L2_PIX_FMT_HEVC_SLICE: > vq->subsystem_flags |= > VB2_V4L2_FL_SUPPORTS_M2M_HOLD_CAPTURE_BUF; > break; ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/4] staging: rtl8188eu: replace tabs with spaces - style
Replace tabs with spaces where appropriate to cleanup whitespace. Signed-off-by: Michael Straube --- drivers/staging/rtl8188eu/core/rtw_sta_mgt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c index 8b7adb9e76c2..73f2cb5ebaa6 100644 --- a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c +++ b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c @@ -167,7 +167,7 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) { s32 index; struct list_head *phash_list; - struct sta_info *psta; + struct sta_info *psta; struct __queue *pfree_sta_queue; struct recv_reorder_ctrl *preorder_ctrl; int i = 0; @@ -318,7 +318,7 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta) spin_lock_bh(_recvframe_queue->lock); - phead = get_list_head(ppending_recvframe_queue); + phead = get_list_head(ppending_recvframe_queue); plist = phead->next; while (!list_empty(phead)) { -- 2.23.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/4] staging: rtl8188eu: remove return variable from rtw_init_bcmc_stainfo
Remove variable res, that is used to store the return value, from rtw_init_bcmc_stainfo. Instead return _FAIL or _SUCCESS directly and remove the now unneeded exit label. Signed-off-by: Michael Straube --- drivers/staging/rtl8188eu/core/rtw_sta_mgt.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c index 6c03068d7ed2..8b7adb9e76c2 100644 --- a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c +++ b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c @@ -451,24 +451,21 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) u32 rtw_init_bcmc_stainfo(struct adapter *padapter) { struct sta_info *psta; - u32 res = _SUCCESS; u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; struct sta_priv *pstapriv = >stapriv; psta = rtw_alloc_stainfo(pstapriv, bc_addr); if (!psta) { - res = _FAIL; RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_, ("rtw_alloc_stainfo fail")); - goto exit; + return _FAIL; } /* default broadcast & multicast use macid 1 */ psta->mac_id = 1; -exit: - return res; + return _SUCCESS; } struct sta_info *rtw_get_bcmc_stainfo(struct adapter *padapter) -- 2.23.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/4] staging: rtl8188eu: reduce indentation level in _rtw_free_sta_priv
Reduce indentation level in _rtw_free_sta_priv by returning early if pstapriv is NULL. Also clears a line over 80 characters checkpatch warning. Signed-off-by: Michael Straube --- drivers/staging/rtl8188eu/core/rtw_sta_mgt.c | 43 ++-- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c index 65a824b4dfe0..6c03068d7ed2 100644 --- a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c +++ b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c @@ -135,31 +135,30 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv) struct recv_reorder_ctrl *preorder_ctrl; int index; - if (pstapriv) { - /* delete all reordering_ctrl_timer */ - spin_lock_bh(>sta_hash_lock); - for (index = 0; index < NUM_STA; index++) { - phead = >sta_hash[index]; - plist = phead->next; - - while (phead != plist) { - int i; - - psta = container_of(plist, struct sta_info, - hash_list); - plist = plist->next; - - for (i = 0; i < 16; i++) { - preorder_ctrl = >recvreorder_ctrl[i]; - del_timer_sync(_ctrl->reordering_ctrl_timer); - } + if (!pstapriv) + return _SUCCESS; + + /* delete all reordering_ctrl_timer */ + spin_lock_bh(>sta_hash_lock); + for (index = 0; index < NUM_STA; index++) { + phead = >sta_hash[index]; + plist = phead->next; + + while (phead != plist) { + int i; + + psta = container_of(plist, struct sta_info, hash_list); + plist = plist->next; + + for (i = 0; i < 16; i++) { + preorder_ctrl = >recvreorder_ctrl[i]; + del_timer_sync(_ctrl->reordering_ctrl_timer); } } - spin_unlock_bh(>sta_hash_lock); - /*===*/ - - vfree(pstapriv->pallocated_stainfo_buf); } + spin_unlock_bh(>sta_hash_lock); + + vfree(pstapriv->pallocated_stainfo_buf); return _SUCCESS; } -- 2.23.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/4] staging: rtl8188eu: remove exit label from rtw_alloc_stainfo
Remove exit label from rtw_alloc_stainfo and simply return NULL instead of goto exit. Suggested-by: Joe Perches Signed-off-by: Michael Straube --- drivers/staging/rtl8188eu/core/rtw_sta_mgt.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c index 776931b8bf72..65a824b4dfe0 100644 --- a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c +++ b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c @@ -181,7 +181,7 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) struct sta_info, list); if (!psta) { spin_unlock_bh(_sta_queue->lock); - goto exit; + return NULL; } list_del_init(>list); @@ -194,8 +194,7 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) if (index >= NUM_STA) { RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_, ("ERROR => %s: index >= NUM_STA", __func__)); - psta = NULL; - goto exit; + return NULL; } phash_list = >sta_hash[index]; @@ -246,7 +245,6 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) /* init for the sequence number of received management frame */ psta->RxMgmtFrameSeqNum = 0x; -exit: return psta; } -- 2.23.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel