lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <80f8123a12fe7706be226dc1831cf929bcd78bef.camel@mediatek.com>
Date: Wed, 23 Oct 2024 10:05:06 +0000
From: CK Hu (胡俊光) <ck.hu@...iatek.com>
To: "sumit.semwal@...aro.org" <sumit.semwal@...aro.org>,
	"christian.koenig@....com" <christian.koenig@....com>, "mchehab@...nel.org"
	<mchehab@...nel.org>, "conor+dt@...nel.org" <conor+dt@...nel.org>,
	"robh@...nel.org" <robh@...nel.org>, "matthias.bgg@...il.com"
	<matthias.bgg@...il.com>, "krzk+dt@...nel.org" <krzk+dt@...nel.org>,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
	Shu-hsiang Yang (楊舒翔)
	<Shu-hsiang.Yang@...iatek.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-mediatek@...ts.infradead.org" <linux-mediatek@...ts.infradead.org>,
	"yunkec@...omium.org" <yunkec@...omium.org>, "linaro-mm-sig@...ts.linaro.org"
	<linaro-mm-sig@...ts.linaro.org>, "linux-media@...r.kernel.org"
	<linux-media@...r.kernel.org>, "devicetree@...r.kernel.org"
	<devicetree@...r.kernel.org>, Yaya Chang (張雅清)
	<Yaya.Chang@...iatek.com>, Project_Global_Chrome_Upstream_Group
	<Project_Global_Chrome_Upstream_Group@...iatek.com>,
	"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
	Teddy Chen (陳乾元) <Teddy.Chen@...iatek.com>,
	"linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "hidenorik@...omium.org"
	<hidenorik@...omium.org>, Shun-Yi Wang (王順億)
	<Shun-Yi.Wang@...iatek.com>
Subject: Re: [PATCH v1 04/10] media: platform: mediatek: add isp_7x cam-raw
 unit

Hi, Shu-hsiang:

On Wed, 2024-10-09 at 19:15 +0800, Shu-hsiang Yang wrote:
> Introduces the ISP pipeline driver for the MediaTek ISP raw and yuv
> modules. Key functionalities include data processing, V4L2 integration,
> resource management, debug support, and various control operations.
> Additionally, IRQ handling, platform device management, and MediaTek
> ISP DMA format support are also included.
> 
> Signed-off-by: Shu-hsiang Yang <Shu-hsiang.Yang@...iatek.com>
> ---

[snip]

> +static int mtk_cam_raw_try_res_ctrl(struct mtk_raw_pipeline *pipeline,
> +				    struct mtk_cam_resource *res_user,
> +				    struct mtk_cam_resource_config *res_cfg,
> +				    struct v4l2_mbus_framefmt *sink_fmt)
> +{
> +	s64 prate = 0;
> +	int width, height;
> +	struct device *dev = pipeline->raw->devs[pipeline->id];
> +
> +	res_cfg->bin_limit = res_user->raw_res.bin; /* 1: force bin on */
> +	res_cfg->frz_limit = 0;
> +	res_cfg->hwn_limit_max = res_user->raw_res.raw_max;
> +	res_cfg->hwn_limit_min = res_user->raw_res.raw_min;
> +	res_cfg->hblank = res_user->sensor_res.hblank;
> +	res_cfg->vblank = res_user->sensor_res.vblank;
> +	res_cfg->sensor_pixel_rate = res_user->sensor_res.pixel_rate;
> +	res_cfg->res_plan = res_user->raw_res.strategy;
> +	res_cfg->raw_feature = res_user->raw_res.feature;
> +	res_cfg->raw_path = res_user->raw_res.path_sel;
> +
> +	if (res_user->sensor_res.cust_pixel_rate)
> +		prate = res_user->sensor_res.cust_pixel_rate;
> +	else if (mtk_cam_feature_is_pure_m2m(res_cfg->raw_feature))
> +		prate = mtk_cam_calc_pure_m2m_pixelrate(sink_fmt->width,
> +							sink_fmt->height,
> +							&res_cfg->interval);
> +	else
> +		prate = mtk_cam_seninf_calc_pixelrate(pipeline->raw->cam_dev,
> +						      sink_fmt->width,
> +						      sink_fmt->height,
> +						      res_user->sensor_res.hblank,
> +						      res_user->sensor_res.vblank,
> +						      res_user->sensor_res.interval.denominator,
> +						      res_user->sensor_res.interval.numerator,
> +						      res_user->sensor_res.pixel_rate);
> +
> +	mtk_cam_raw_resource_calc(dev_get_drvdata(pipeline->raw->cam_dev),
> +				  res_cfg, prate, res_cfg->res_plan,
> +				  sink_fmt->width, sink_fmt->height,
> +				  &width, &height);

If the basic function support only imgo unprocessed, does the unprocessed path imply the resource could be fixed?
I mean it's not necessary to calculate resource when imgo unprocessed path.
If so, remove resource calculation related code in this basic patch and add it back in advance function patch.

Regards,
CK

> +
> +	if (res_user->raw_res.bin && !res_cfg->bin_enable) {
> +		dev_err(dev,
> +			"%s:pipe(%d): res calc failed on fource bin: user(%d)/bin_enable(%d)\n",
> +			__func__, pipeline->id,	res_user->raw_res.bin,
> +			res_cfg->bin_enable);
> +		return -EINVAL;
> +	}
> +
> +	if (res_cfg->raw_num_used > res_user->raw_res.raw_max ||
> +	    res_cfg->raw_num_used < res_user->raw_res.raw_min) {
> +		dev_err(dev,
> +			"%s:pipe(%d): res calc failed on raw used: user(%d/%d)/raw_num_used(%d)\n",
> +			__func__, pipeline->id, res_user->raw_res.raw_max,
> +			res_user->raw_res.raw_min, res_cfg->raw_num_used);
> +	}
> +
> +	res_user->raw_res.pixel_mode = res_cfg->tgo_pxl_mode;
> +	res_user->raw_res.raw_used = res_cfg->raw_num_used;
> +	if (res_cfg->bin_limit == BIN_AUTO)
> +		res_user->raw_res.bin = res_cfg->bin_enable;
> +	else
> +		res_user->raw_res.bin = res_cfg->bin_limit;
> +
> +	dev_info(dev,
> +		 "%s:pipe(%d): res calc result: raw_used(%d)/bin(%d)/pixelmode(%d)/strategy(%d)\n",
> +		 __func__, pipeline->id, res_user->raw_res.raw_used,
> +		 res_user->raw_res.bin, res_user->raw_res.pixel_mode,
> +		 res_user->raw_res.strategy);
> +
> +	/**
> +	 * Other output not reveal to user:
> +	 * res_cfg->res_strategy[MTK_CAMSYS_RES_STEP_NUM];
> +	 * res_cfg->clk_target;
> +	 * res_cfg->frz_enable;
> +	 * res_cfg->frz_ratio;
> +	 * res_cfg->tgo_pxl_mode;
> +	 */
> +	if (width != sink_fmt->width || height != sink_fmt->height) {
> +		dev_info(dev,
> +			 "%s:pipe(%d): size adjust info: raw: sink(%d,%d) res:(%d,%d)\n",
> +			__func__, pipeline->id, sink_fmt->width,
> +			sink_fmt->height, width, height);
> +	}
> +
> +	return 0;
> +}
> +

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ