linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Ming Qian <ming.qian@nxp.com>
To: Nicolas Dufresne <nicolas@ndufresne.ca>,
	"mchehab@kernel.org" <mchehab@kernel.org>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>
Cc: "hverkuil-cisco@xs4all.nl" <hverkuil-cisco@xs4all.nl>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	dl-linux-imx <linux-imx@nxp.com>,
	Aisheng Dong <aisheng.dong@nxp.com>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: RE: [EXT] Re: [PATCH v9 06/13] media: amphion: add vpu v4l2 m2m support
Date: Fri, 24 Sep 2021 01:58:22 +0000	[thread overview]
Message-ID: <AM6PR04MB63411CD5CD3B0EBF22224C8BE7A49@AM6PR04MB6341.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <f1e11d2192dcb9ce0b792c3640924881b634d776.camel@ndufresne.ca>

> -----Original Message-----
> From: Nicolas Dufresne [mailto:nicolas@ndufresne.ca]
> Sent: Thursday, September 23, 2021 10:40 PM
> To: Ming Qian <ming.qian@nxp.com>; mchehab@kernel.org;
> shawnguo@kernel.org; robh+dt@kernel.org; s.hauer@pengutronix.de
> Cc: hverkuil-cisco@xs4all.nl; kernel@pengutronix.de; festevam@gmail.com;
> dl-linux-imx <linux-imx@nxp.com>; Aisheng Dong <aisheng.dong@nxp.com>;
> linux-media@vger.kernel.org; linux-kernel@vger.kernel.org;
> devicetree@vger.kernel.org; linux-arm-kernel@lists.infradead.org
> Subject: [EXT] Re: [PATCH v9 06/13] media: amphion: add vpu v4l2 m2m
> support
> 
> Caution: EXT Email
> 
> Le lundi 13 septembre 2021 à 17:11 +0800, Ming Qian a écrit :
> > vpu_v4l2.c implements the v4l2 m2m driver methods.
> > vpu_helpers.c implements the common helper functions
> > vpu_color.c converts the v4l2 colorspace with iso
> >
> > Signed-off-by: Ming Qian <ming.qian@nxp.com>
> > Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
> > Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
> > Reported-by: kernel test robot <lkp@intel.com>
> > ---
> >  drivers/media/platform/amphion/vpu_color.c   | 192 ++++++
> >  drivers/media/platform/amphion/vpu_helpers.c | 453 ++++++++++++++
> >  drivers/media/platform/amphion/vpu_helpers.h |  72 +++
> >  drivers/media/platform/amphion/vpu_v4l2.c    | 625
> +++++++++++++++++++
> >  drivers/media/platform/amphion/vpu_v4l2.h    |  53 ++
> >  5 files changed, 1395 insertions(+)
> >  create mode 100644 drivers/media/platform/amphion/vpu_color.c
> >  create mode 100644 drivers/media/platform/amphion/vpu_helpers.c
> >  create mode 100644 drivers/media/platform/amphion/vpu_helpers.h
> >  create mode 100644 drivers/media/platform/amphion/vpu_v4l2.c
> >  create mode 100644 drivers/media/platform/amphion/vpu_v4l2.h
> >
> > +dma_addr_t vpu_get_vb_phy_addr(struct vb2_buffer *vb, u32 plane_no)
> > +{
> > +     return vb2_dma_contig_plane_dma_addr(vb, plane_no) +
> > +                     vb->planes[plane_no].data_offset;
> 
> I've change the num_planes to 1 (tried 2, but failed differently), and it
> crashed while running:
> 
> GST_DEBUG="v4l2*:7" gst-launch-1.0 videotestsrc num-buffers=100 !
> v4l2h264enc ! fakesink
> 
> So perhaps there is a overall review of the buffer allocation vs S_FMT
> implementation to be done here.

Hi Nicolas,
   What's the failure of setting num_planes to 2?
   When num_planes is set to 1, driver still try to access the planes[1], but got NULL pointer. Then led to this panic.
   I'll try to support V4L2_PIX_FMT_NV12M, and check the plane number carefully.

> 
> [   81.520167] Unable to handle kernel NULL pointer dereference at virtual
> address 0000000000000000
> [   81.529168] Mem abort info:
> [   81.532467]   ESR = 0x96000004
> [   81.539550]   EC = 0x25: DABT (current EL), IL = 32 bits
> [   81.546053]   SET = 0, FnV = 0
> [   81.549771]   EA = 0, S1PTW = 0
> [   81.553186]   FSC = 0x04: level 0 translation fault
> [   81.558280] Data abort info:
> [   81.561437]   ISV = 0, ISS = 0x00000004
> [   81.565527]   CM = 0, WnR = 0
> [   81.568581] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000882741000
> [   81.575840] [0000000000000000] pgd=0000000000000000,
> p4d=0000000000000000
> [   81.586637] Internal error: Oops: 96000004 [#1] PREEMPT SMP
> [   81.592247] Modules linked in: amphion_vpu_core v4l2_mem2mem
> videobuf2_vmalloc videobuf2_dma_contig videobuf2_memops videobuf2_v4l2
> videobuf2_common imx_sc_key imx_sc_thermal crct10dif_ce rtc_imx_sc
> imx_sc_wdt
> amphion_vpu_dev fsl_imx8_ddr_perf isl29018 mpl3115
> industrialio_triggered_buffer
> kfifo_buf videodev mc fuse drm ip_tables x_tables ipv6
> [   81.622805] CPU: 0 PID: 348 Comm: videotestsrc0:s Not tainted
> 5.15.0-rc2-
> imx8qxp+ #2
> [   81.630562] Hardware name: Freescale i.MX8QXP MEK (DT)
> [   81.635711] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS
> BTYPE=--)
> [   81.642687] pc : vpu_get_vb_phy_addr+0x28/0x50 [amphion_vpu_core]
> [   81.648838] lr : vpu_get_vb_phy_addr+0x20/0x50 [amphion_vpu_core]
> [   81.654971] sp : ffff800012fcba30
> [   81.658287] x29: ffff800012fcba30 x28: ffff800012bd1040 x27:
> 0000000000000000
> [   81.665449] x26: 0000000000000000 x25: ffff800012fcbd28 x24:
> ffff800012bd1010
> [   81.672607] x23: ffff800012bd3200 x22: 0000000000000000 x21:
> ffff800015807044
> [   81.679766] x20: ffff000806a1ec00 x19: 0000000000000003 x18:
> 0000000000000000
> [   81.686924] x17: 0000000000000000 x16: 0000000000000000 x15:
> 0000a95ba29c327a
> [   81.694083] x14: 000000000000039f x13: 0000000000000000 x12:
> 0000000000000000
> [   81.701241] x11: 0000000000000000 x10: 0000000000000990 x9 :
> ffff800012fcb900
> [   81.708400] x8 : ffff0008068f97f0 x7 : ffff00083f98b180 x6 :
> ffff000802070af8
> [   81.715558] x5 : ffff000802070af8 x4 : ffff800009296000 x3 :
> ffff000802073480
> [   81.722717] x2 : ffff000806a1ec00 x1 : 0000000000000002 x0 :
> 0000000000000000
> [   81.729877] Call trace:
> [   81.732332]  vpu_get_vb_phy_addr+0x28/0x50 [amphion_vpu_core]
> [   81.738119]  vpu_windsor_input_frame+0x84/0xbc [amphion_vpu_core]
> [   81.744252]  venc_process_output+0x88/0x10c [amphion_vpu_core]
> [   81.750125]  vpu_process_output_buffer+0xac/0x100
> [amphion_vpu_core]
> [   81.756519]  venc_start_session+0x264/0x2cc [amphion_vpu_core]
> [   81.762392]  vpu_vb2_start_streaming+0x88/0xf4 [amphion_vpu_core]
> [   81.768525]  vb2_start_streaming+0x68/0x15c [videobuf2_common]
> [   81.774398]  vb2_core_streamon+0x94/0x19c [videobuf2_common]
> [   81.780088]  vb2_streamon+0x20/0x70 [videobuf2_v4l2]
> [   81.785083]  v4l2_m2m_ioctl_streamon+0x3c/0xa0 [v4l2_mem2mem]
> [   81.790869]  v4l_streamon+0x28/0x34 [videodev]
> [   81.795412]  __video_do_ioctl+0x17c/0x3e0 [videodev]
> [   81.800460]  video_usercopy+0x368/0x7e0 [videodev]
> [   81.805333]  video_ioctl2+0x1c/0x3c [videodev]
> [   81.809859]  v4l2_ioctl+0x44/0x64 [videodev]
> [   81.814211]  __arm64_sys_ioctl+0xac/0xf0
> [   81.818155]  invoke_syscall+0x48/0x114
> [   81.821917]  el0_svc_common.constprop.0+0x44/0xfc
> [   81.826635]  do_el0_svc+0x2c/0x94
> [   81.829961]  el0_svc+0x28/0x80
> [   81.833027]  el0t_64_sync_handler+0xa8/0x130
> [   81.837311]  el0t_64_sync+0x1a0/0x1a4
> [   81.840992] Code: aa0003f4 97ff02f9 d37f7e61 8b334033 (f9400000)
> [   81.847099] ---[ end trace 46cf421377a59de1 ]---
> 
> 
> 
> 
> > +}
> > +

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-09-24  2:00 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13  9:11 [PATCH v9 00/13] amphion video decoder/encoder driver Ming Qian
2021-09-13  9:11 ` [PATCH v9 01/13] dt-bindings: media: amphion: add amphion video codec bindings Ming Qian
2021-09-13  9:11 ` [PATCH v9 02/13] media:Add nt8 and nt10 video format Ming Qian
2021-09-13  9:11 ` [PATCH v9 03/13] media: amphion: add amphion vpu device driver Ming Qian
2021-09-13  9:11 ` [PATCH v9 04/13] media: amphion: add vpu core driver Ming Qian
2021-09-22 13:10   ` Nicolas Dufresne
2021-09-23 14:27   ` Nicolas Dufresne
2021-09-24  1:52     ` [EXT] " Ming Qian
2021-09-13  9:11 ` [PATCH v9 05/13] media: amphion: implement vpu core communication based on mailbox Ming Qian
2021-09-13  9:11 ` [PATCH v9 06/13] media: amphion: add vpu v4l2 m2m support Ming Qian
2021-09-23 14:39   ` Nicolas Dufresne
2021-09-24  1:58     ` Ming Qian [this message]
2021-09-13  9:11 ` [PATCH v9 07/13] media: amphion: add v4l2 m2m vpu encoder stateful driver Ming Qian
2021-09-23 14:22   ` Nicolas Dufresne
2021-09-24  1:47     ` [EXT] " Ming Qian
2021-09-13  9:11 ` [PATCH v9 08/13] media: amphion: add v4l2 m2m vpu decoder " Ming Qian
2021-09-13  9:11 ` [PATCH v9 09/13] media: amphion: implement windsor encoder rpc interface Ming Qian
2021-09-13  9:11 ` [PATCH v9 10/13] media: amphion: implement malone decoder " Ming Qian
2021-09-13  9:11 ` [PATCH v9 11/13] ARM64: dts: freescale: imx8q: add imx vpu codec entries Ming Qian
2021-09-22 12:55   ` Nicolas Dufresne
2021-09-23 10:31     ` [EXT] " Ming Qian
2021-09-23 13:27       ` Nicolas Dufresne
2021-09-13  9:11 ` [PATCH v9 12/13] firmware: imx: scu-pd: imx8q: add vpu mu resources Ming Qian
2021-09-13  9:11 ` [PATCH v9 13/13] MAINTAINERS: add AMPHION VPU CODEC V4L2 driver entry Ming Qian
2021-09-22 14:13 ` [PATCH v9 00/13] amphion video decoder/encoder driver Nicolas Dufresne
2021-09-23 10:45   ` [EXT] " Ming Qian
2021-09-23 13:33     ` Nicolas Dufresne
2021-09-24  1:43       ` Ming Qian
2021-10-11  9:12       ` Hans Verkuil

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=AM6PR04MB63411CD5CD3B0EBF22224C8BE7A49@AM6PR04MB6341.eurprd04.prod.outlook.com \
    --to=ming.qian@nxp.com \
    --cc=aisheng.dong@nxp.com \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=nicolas@ndufresne.ca \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).