From: Boris Brezillon <boris.brezillon-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
To: Ezequiel Garcia <ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
Cc: kernel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org,
ZhiChao Yu <zhichao.yu-TNX95d0MmH7DzftRWevZcw@public.gmane.org>,
Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>,
Jonas Karlman <jonas-uIzNG4q0ceqzQB+pC5nmwQ@public.gmane.org>,
Tomasz Figa <tfiga-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Hans Verkuil
<hans.verkuil-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>,
Philipp Zabel <p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
Nicolas Dufresne
<nicolas.dufresne-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>,
linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 2/2] media: hantro: Add support for VP8 decoding on rk3288
Date: Mon, 17 Jun 2019 15:40:24 +0200 [thread overview]
Message-ID: <20190617154024.1fdb5d3c@collabora.com> (raw)
In-Reply-To: <20190613151040.8971-3-ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
On Thu, 13 Jun 2019 12:10:40 -0300
Ezequiel Garcia <ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org> 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?
WARNING: multiple messages have this Message-ID (diff)
From: Boris Brezillon <boris.brezillon@collabora.com>
To: Ezequiel Garcia <ezequiel@collabora.com>
Cc: linux-media@vger.kernel.org,
Hans Verkuil <hans.verkuil@cisco.com>,
kernel@collabora.com,
Nicolas Dufresne <nicolas.dufresne@collabora.com>,
Tomasz Figa <tfiga@chromium.org>,
linux-rockchip@lists.infradead.org,
Heiko Stuebner <heiko@sntech.de>, Jonas Karlman <jonas@kwiboo.se>,
Philipp Zabel <p.zabel@pengutronix.de>,
ZhiChao Yu <zhichao.yu@rock-chips.com>
Subject: Re: [PATCH 2/2] media: hantro: Add support for VP8 decoding on rk3288
Date: Mon, 17 Jun 2019 15:40:24 +0200 [thread overview]
Message-ID: <20190617154024.1fdb5d3c@collabora.com> (raw)
In-Reply-To: <20190613151040.8971-3-ezequiel@collabora.com>
On Thu, 13 Jun 2019 12:10:40 -0300
Ezequiel Garcia <ezequiel@collabora.com> 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?
next prev parent reply other threads:[~2019-06-17 13:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-13 15:10 [PATCH 0/2] RK3288 VP8 decoding support Ezequiel Garcia
2019-06-13 15:10 ` Ezequiel Garcia
[not found] ` <20190613151040.8971-1-ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2019-06-13 15:10 ` [PATCH 1/2] media: uapi: Add VP8 stateless decoder API Ezequiel Garcia
2019-06-13 15:10 ` Ezequiel Garcia
[not found] ` <20190613151040.8971-2-ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2019-06-17 13:23 ` Boris Brezillon
2019-06-17 13:23 ` Boris Brezillon
[not found] ` <20190617152310.299d60e8-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2019-06-20 3:46 ` Ezequiel Garcia
2019-06-20 3:46 ` Ezequiel Garcia
2019-06-13 15:10 ` [PATCH 2/2] media: hantro: Add support for VP8 decoding on rk3288 Ezequiel Garcia
2019-06-13 15:10 ` Ezequiel Garcia
[not found] ` <20190613151040.8971-3-ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2019-06-17 13:40 ` Boris Brezillon [this message]
2019-06-17 13:40 ` Boris Brezillon
[not found] ` <20190617154024.1fdb5d3c-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2019-06-20 3:47 ` Ezequiel Garcia
2019-06-20 3:47 ` Ezequiel Garcia
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190617154024.1fdb5d3c@collabora.com \
--to=boris.brezillon-zgy8ohtn/8qb+jhodadfcq@public.gmane.org \
--cc=ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org \
--cc=hans.verkuil-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
--cc=heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org \
--cc=jonas-uIzNG4q0ceqzQB+pC5nmwQ@public.gmane.org \
--cc=kernel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org \
--cc=linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=nicolas.dufresne-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org \
--cc=p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
--cc=tfiga-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=zhichao.yu-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.