From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C529C43613 for ; Thu, 20 Jun 2019 03:47:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0C8D420B1F for ; Thu, 20 Jun 2019 03:47:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726647AbfFTDrl (ORCPT ); Wed, 19 Jun 2019 23:47:41 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:45866 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726389AbfFTDrl (ORCPT ); Wed, 19 Jun 2019 23:47:41 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id 442C0260E5C Message-ID: <94add735d542fcf9236869801303a446d4b19996.camel@collabora.com> Subject: Re: [PATCH 2/2] media: hantro: Add support for VP8 decoding on rk3288 From: Ezequiel Garcia To: Boris Brezillon Cc: linux-media@vger.kernel.org, Hans Verkuil , kernel@collabora.com, Nicolas Dufresne , Tomasz Figa , linux-rockchip@lists.infradead.org, Heiko Stuebner , Jonas Karlman , Philipp Zabel , ZhiChao Yu Date: Thu, 20 Jun 2019 00:47:29 -0300 In-Reply-To: <20190617154024.1fdb5d3c@collabora.com> References: <20190613151040.8971-1-ezequiel@collabora.com> <20190613151040.8971-3-ezequiel@collabora.com> <20190617154024.1fdb5d3c@collabora.com> Organization: Collabora Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On Mon, 2019-06-17 at 15:40 +0200, Boris Brezillon wrote: > On Thu, 13 Jun 2019 12:10:40 -0300 > Ezequiel Garcia wrote: > > > > +static void cfg_parts(struct hantro_ctx *ctx, > > + const struct v4l2_ctrl_vp8_frame_header *hdr) > > +{ > > + struct hantro_dev *vpu = ctx->dev; > > + struct vb2_v4l2_buffer *vb2_src; > > + u32 first_part_offset = VP8_FRAME_IS_KEY_FRAME(hdr) ? 10 : 3; > > + u32 dct_part_total_len = 0; > > + u32 dct_size_part_size = 0; > > + u32 dct_part_offset = 0; > > + u32 mb_offset_bytes = 0; > > + u32 mb_offset_bits = 0; > > + u32 mb_start_bits = 0; > > + struct vp8_dec_reg reg; > > + dma_addr_t src_dma; > > + u32 mb_size = 0; > > + u32 count = 0; > > + u32 i; > > + > > + vb2_src = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx); > > + src_dma = vb2_dma_contig_plane_dma_addr(&vb2_src->vb2_buf, 0); > > + > > + /* > > + * Calculate control partition mb data info > > + * @macroblock_bit_offset: bits offset of mb data from first > > + * part start pos > > + * @mb_offset_bits: bits offset of mb data from src_dma > > + * base addr > > + * @mb_offset_byte: bytes offset of mb data from src_dma > > + * base addr > > + * @mb_start_bits: bits offset of mb data from mb data > > + * 64bits alignment addr > > + */ > > + mb_offset_bits = first_part_offset * 8 > > + + hdr->macroblock_bit_offset + 8; > > + mb_offset_bytes = mb_offset_bits / 8; > > + mb_start_bits = mb_offset_bits > > + - (mb_offset_bytes & (~DEC_8190_ALIGN_MASK)) * 8; > > + mb_size = hdr->first_part_size > > + - (mb_offset_bytes - first_part_offset) > > + + (mb_offset_bytes & DEC_8190_ALIGN_MASK); > > Nit: can we have operators placed at the end of a line instead of > the beginning of the following line? Sure. Thanks for the review, Eze From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ezequiel Garcia Subject: Re: [PATCH 2/2] media: hantro: Add support for VP8 decoding on rk3288 Date: Thu, 20 Jun 2019 00:47:29 -0300 Message-ID: <94add735d542fcf9236869801303a446d4b19996.camel@collabora.com> References: <20190613151040.8971-1-ezequiel@collabora.com> <20190613151040.8971-3-ezequiel@collabora.com> <20190617154024.1fdb5d3c@collabora.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20190617154024.1fdb5d3c-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+glpar-linux-rockchip=m.gmane.org-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org To: Boris Brezillon Cc: kernel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org, ZhiChao Yu , Heiko Stuebner , Jonas Karlman , Tomasz Figa , linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Hans Verkuil , Philipp Zabel , Nicolas Dufresne , linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-rockchip.vger.kernel.org On Mon, 2019-06-17 at 15:40 +0200, Boris Brezillon wrote: > On Thu, 13 Jun 2019 12:10:40 -0300 > Ezequiel Garcia wrote: > > > > +static void cfg_parts(struct hantro_ctx *ctx, > > + const struct v4l2_ctrl_vp8_frame_header *hdr) > > +{ > > + struct hantro_dev *vpu = ctx->dev; > > + struct vb2_v4l2_buffer *vb2_src; > > + u32 first_part_offset = VP8_FRAME_IS_KEY_FRAME(hdr) ? 10 : 3; > > + u32 dct_part_total_len = 0; > > + u32 dct_size_part_size = 0; > > + u32 dct_part_offset = 0; > > + u32 mb_offset_bytes = 0; > > + u32 mb_offset_bits = 0; > > + u32 mb_start_bits = 0; > > + struct vp8_dec_reg reg; > > + dma_addr_t src_dma; > > + u32 mb_size = 0; > > + u32 count = 0; > > + u32 i; > > + > > + vb2_src = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx); > > + src_dma = vb2_dma_contig_plane_dma_addr(&vb2_src->vb2_buf, 0); > > + > > + /* > > + * Calculate control partition mb data info > > + * @macroblock_bit_offset: bits offset of mb data from first > > + * part start pos > > + * @mb_offset_bits: bits offset of mb data from src_dma > > + * base addr > > + * @mb_offset_byte: bytes offset of mb data from src_dma > > + * base addr > > + * @mb_start_bits: bits offset of mb data from mb data > > + * 64bits alignment addr > > + */ > > + mb_offset_bits = first_part_offset * 8 > > + + hdr->macroblock_bit_offset + 8; > > + mb_offset_bytes = mb_offset_bits / 8; > > + mb_start_bits = mb_offset_bits > > + - (mb_offset_bytes & (~DEC_8190_ALIGN_MASK)) * 8; > > + mb_size = hdr->first_part_size > > + - (mb_offset_bytes - first_part_offset) > > + + (mb_offset_bytes & DEC_8190_ALIGN_MASK); > > Nit: can we have operators placed at the end of a line instead of > the beginning of the following line? Sure. Thanks for the review, Eze