Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp272246rdf; Tue, 21 Nov 2023 02:12:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IFRctjqETkWV2tH/fye/FTae6lU/0DDH45WCZlWNrsa291a5bMtmE8qggZbB6KtdmRqbjWr X-Received: by 2002:a17:90b:350e:b0:283:9a71:4578 with SMTP id ls14-20020a17090b350e00b002839a714578mr8373617pjb.37.1700561520033; Tue, 21 Nov 2023 02:12:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700561520; cv=none; d=google.com; s=arc-20160816; b=fSq+rjUtro+ErE3s5z/8xCjlPy3Svtfnj8eDFVT9AcgvMnN+mPdtVPukvGh0ZdmeVs +pvnraqfmXop8/FRBEw7mN46HM1PEbNWeYQV4HnGVnVQP7ozpppkruqRE40TCjXXT3Ay lq2mVktC9ZOcwU05ub18rmwbP7fzMWSnRpnJqb5ojFRCBv9gqtjy5MMGUhO/rOmx0GUq FuNdu1/pM6WdeqHehNYGxltWfFRXah9OTM8LWmdMRPyJyo5EsWJAkgegHEyY4kshDQ1I FNqVrpdyknXE/15vtg0Y9xjI3t2TXkOKofUAw/vm8vn/Cx8JbG9o73HGjJk//Xjz73yi uxGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=h77UCHBzfS9YsxxGuMxQKATmfaJKyNycbGsrjaUmphU=; fh=O9UUzJPi8EOv62sI/lDG+RN+T0kfdG51kBf0zhN+b6g=; b=PlVFmUAbRhsDUgQe/IxOfw1KmHRb5krw58HUSwv/ivycHxxsaxQV9Pd5sX3DZ7knxm aTEKPajIyALZMo0oybsQ2bq9n+hWFoLyMByqQThnmqTVFuau9v4mhHLbcypsytZlnhXY +tGrlGvO4IbxMQ5JrWa7NYEmbLunhAHfP7BRnDvQ19Fof8hp7Tjx3WU5OBApbf3+OaIP 93xbm/bSbA/UE3d0+ry4uFkhmXfE8ZpmrMy6waWfQJym5HklCmohDSTMrDD09Pugdt7/ OXkUEMNSBHvpKCyYk5IttfVm7XIX+Zk8GelbLFfbmoDqYAXiGPgEklMiByf06K+3g6I0 0iEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=U1vMUiC7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id ls8-20020a17090b350800b002850d9700a8si7530406pjb.21.2023.11.21.02.11.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 02:12:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=U1vMUiC7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 4C2958059341; Tue, 21 Nov 2023 02:11:57 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233695AbjKUKLu (ORCPT + 99 others); Tue, 21 Nov 2023 05:11:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230274AbjKUKLs (ORCPT ); Tue, 21 Nov 2023 05:11:48 -0500 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0816FC1; Tue, 21 Nov 2023 02:11:45 -0800 (PST) Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6cb74a527ceso1660090b3a.2; Tue, 21 Nov 2023 02:11:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700561504; x=1701166304; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=h77UCHBzfS9YsxxGuMxQKATmfaJKyNycbGsrjaUmphU=; b=U1vMUiC7Kj96pVlXogZWS8uk5x5NwUT3uzMVQoIZJSkW0JbbrRSD1ScaoQpW3vDZFl dcSUePPgJkYAQZTcFBkbTs1v1uuub2zheqZTflwUqTzyYPI9EgDKaZ+XkkG/N25KftXk goChYmzJdeQqyZhb+Iqcp1TbKF99L5zH3yMrBrTJwWTc5+/2RhE3ZPYmNe5JLXG/hxnH /4Uq2QNT3YiRO7QAUm5b5oW4f0WIM7cMTJI4cM15lbtzTbIKzI7ZQNPwJPqP9t1b2y0M cdJ62GL5ijKR6Cr+cscL/JwF78/DRNEYmipDOQ8S4R5ALYeEwrl1qLRkjv+AictMLmJ0 +BuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700561504; x=1701166304; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h77UCHBzfS9YsxxGuMxQKATmfaJKyNycbGsrjaUmphU=; b=Ak6H/jwWPzSm8xy6WuE0SI6RvLJ5POoklKNDwIDgTTFl73IedzNH1X8gH1XA/H5uWZ nvH+CC7JJ3qHhg+vJVWweZa442vN6oQqJxQeNx/UyKqmuEUjiN0qJJJ7dYfYOBn+pld/ bQ0pN8bDHgnccNw7K9X7HjzALaphnQrZJ9RC3gEDP5jK7UpIWaHngCCabzjG+kziuVWA UdqtqcX1ZRZxLSUzsiCqsPlmXD3+gQoD7lsG/kxdP0LLL4uUVqad8ioJgnXRGVy1miku MyPZEzQivVZ4LT0LO7bOpW/f8phr7jQ1pWuaXMclFPi+e/w/Hm+MtZ1b3jWr/cJNfWoQ ihLg== X-Gm-Message-State: AOJu0YxPlTzBPuGS/GdMGIqgetyoBpNdGl8CxD4hYYNQU7vrNBCoVojl WNemgq3mIXkjQmlz4ybjOZRsZWkgeHoper3dI0s= X-Received: by 2002:a05:6a21:789d:b0:187:15e2:fdd9 with SMTP id bf29-20020a056a21789d00b0018715e2fdd9mr8857392pzc.39.1700561504425; Tue, 21 Nov 2023 02:11:44 -0800 (PST) MIME-Version: 1.0 References: <1700552255-5364-1-git-send-email-shengjiu.wang@nxp.com> <1700552255-5364-14-git-send-email-shengjiu.wang@nxp.com> <0026a04d-8a04-4eeb-9f03-c68be6da5ec5@xs4all.nl> In-Reply-To: <0026a04d-8a04-4eeb-9f03-c68be6da5ec5@xs4all.nl> From: Shengjiu Wang Date: Tue, 21 Nov 2023 18:11:33 +0800 Message-ID: Subject: Re: [PATCH v10 13/14] media: imx-asrc: Add memory to memory driver To: Hans Verkuil Cc: Shengjiu Wang , sakari.ailus@iki.fi, tfiga@chromium.org, m.szyprowski@samsung.com, mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 21 Nov 2023 02:11:57 -0800 (PST) On Tue, Nov 21, 2023 at 5:20=E2=80=AFPM Hans Verkuil w= rote: > > On 21/11/2023 08:37, Shengjiu Wang wrote: > > Implement the ASRC memory to memory function using > > the v4l2 framework, user can use this function with > > v4l2 ioctl interface. > > > > User send the output and capture buffer to driver and > > driver store the converted data to the capture buffer. > > > > This feature can be shared by ASRC and EASRC drivers > > > > Signed-off-by: Shengjiu Wang > > --- > > drivers/media/platform/nxp/Kconfig | 13 + > > drivers/media/platform/nxp/Makefile | 1 + > > drivers/media/platform/nxp/imx-asrc.c | 1264 +++++++++++++++++++++++++ > > 3 files changed, 1278 insertions(+) > > create mode 100644 drivers/media/platform/nxp/imx-asrc.c > > > > > > > +static const struct v4l2_ctrl_config asrc_src_rate_off_control =3D { > > + .ops =3D &asrc_m2m_ctrl_ops, > > + .id =3D V4L2_CID_M2M_AUDIO_SOURCE_RATE_OFFSET, > > + .name =3D "Audio Source Sample Rate Offset", > > + .type =3D V4L2_CTRL_TYPE_INTEGER64, > > Do you need this to be INTEGER64? If the actual number of bits > of the fixed point value that the hardware uses fits in 32 bits, > then you can just use the INTEGER type. > > > + .min =3D 0xFFFFFF0000000000, > > + .max =3D 0x7fffffffff, > > + .def =3D 0, > > + .step =3D 1, > > + .flags =3D V4L2_CTRL_FLAG_UPDATE, > > + .fraction_bits =3D 32, > > Can't you use the actual number of fraction bits that the hardware > uses? I can't imagine that it is actually 32 bits, it is almost > certainly less. > From the ratio point view, it is 44bits. maximum 39 fractional bits. > I do think that we need a helper function to fill in the min/max values. what's the helper function look like? Where can I find an example? best regards wang shengjiu > > Regards, > > Hans > > > +}; > > + > > +static const struct v4l2_ctrl_config asrc_dst_rate_off_control =3D { > > + .ops =3D &asrc_m2m_ctrl_ops, > > + .id =3D V4L2_CID_M2M_AUDIO_DEST_RATE_OFFSET, > > + .name =3D "Audio Dest Sample Rate Offset", > > + .type =3D V4L2_CTRL_TYPE_INTEGER64, > > + .min =3D 0xFFFFFF0000000000, > > + .max =3D 0x7fffffffff, > > + .def =3D 0, > > + .step =3D 1, > > + .flags =3D V4L2_CTRL_FLAG_UPDATE, > > + .fraction_bits =3D 32, > > +}; >