From: Liu Ying <victor.liu@nxp.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org,
p.zabel@pengutronix.de, airlied@gmail.com, simona@ffwll.ch,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
tzimmermann@suse.de, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de,
kernel@pengutronix.de, festevam@gmail.com, tglx@linutronix.de,
vkoul@kernel.org, kishon@kernel.org, aisheng.dong@nxp.com,
agx@sigxcpu.org, u.kleine-koenig@baylibre.com,
francesco@dolcini.it, frank.li@nxp.com
Subject: Re: [PATCH v7 10/19] drm/imx: Add i.MX8qxp Display Controller pixel engine
Date: Tue, 24 Dec 2024 14:47:48 +0800 [thread overview]
Message-ID: <214b2282-fc83-4a25-8cf3-ce2b57b59eae@nxp.com> (raw)
In-Reply-To: <7k2jqpkpagm3x7shywgzvtst364f6dmmhuz2covpbvghoa5rzc@3dvlbdgtnjck>
On 12/23/2024, Dmitry Baryshkov wrote:
> On Mon, Dec 23, 2024 at 02:41:38PM +0800, Liu Ying wrote:
>> i.MX8qxp Display Controller pixel engine consists of all processing
>> units that operate in the AXI bus clock domain. Add drivers for
>> ConstFrame, ExtDst, FetchLayer, FetchWarp and LayerBlend units, as
>> well as a pixel engine driver, so that two displays with primary
>> planes can be supported. The pixel engine driver and those unit
>> drivers are components to be aggregated by a master registered in
>> the upcoming DRM driver.
>>
>> Reviewed-by: Maxime Ripard <mripard@kernel.org>
>> Signed-off-by: Liu Ying <victor.liu@nxp.com>
>> ---
>> v7:
>> * Add kernel doc for struct dc_drm_device. (Dmitry)
>> * Fix regmap_config definitions by correcting name field, correcting read
>> ranges and setting max_register field.
>> * Get instance numbers from device data(compatible strings) instead of OF
>> aliases.
>> * Collect Maxime's R-b tag.
>> * Trivial tweaks.
>>
>> v6:
>> * Fix build warning by expanding sizeof(fu->name) from 13 to 21.
>> (kernel test robot)
>>
>> v5:
>> * Replace .remove_new with .remove in dc-{cf,de,fl,fw,lb,pe}.c. (Uwe)
>> * Fix commit message to state that pixel engine driver is a component driver
>> instead of a master/aggregate driver.
>>
>> v4:
>> * Use regmap to define register map for all registers. (Dmitry)
>> * Use regmap APIs to access registers. (Dmitry)
>> * Inline some small functions. (Dmitry)
>> * Move dc_lb_blendcontrol() function call from KMS routine to initialization
>> stage. (Dmitry)
>> * Use devm_kzalloc() to drmm_kzalloc() to allocate dc_* data strutures.
>> * Drop unnecessary private struct dc_*_priv.
>> * Set suppress_bind_attrs driver flag to true to avoid unnecessary sys
>> interfaces to bind/unbind the drivers.
>> * Make some fetch unit operations be aware of fractional fetch unit index(0-7).
>>
>> v3:
>> * No change.
>>
>> v2:
>> * Use OF alias id to get instance id.
>
> Carrying several comments from previous patch:
> - shdld vs shdload
Will change IRQ names from shdld to shdload.
> - use of indices in the compat strings
Maybe keep adding indices in the compatible strings since I explained in
my replies to your comments on patch 3 and 9.
> - bind() behaviour depending on the particular order of device bindings
As I explained in the my reply to patch 9, bind() behaviour is deterministic.
>
>>
>> +
>> +void dc_fu_common_hw_init(struct dc_fu *fu)
>> +{
>> + enum dc_fu_frac frac;
>> + int i;
>> +
>> + dc_fu_baddr_autoupdate(fu, 0x0);
>> + dc_fu_enable_shden(fu);
>> + dc_fu_set_linemode(fu, LINEMODE_DISPLAY);
>> + dc_fu_set_numbuffers(fu, 16);
>> +
>> + for (i = 0; i < ARRAY_SIZE(dc_fetchunit_all_fracs); i++) {
>
> for (i = DC_FETCHUNIT_FRAC0 ; i < DC_FETCHUNIT_FRAC_NUM; i++) ?
Ack.
>
>> + frac = dc_fetchunit_all_fracs[i];
>> +
>> + dc_fu_layeroffset(fu, frac, 0, 0);
>> + dc_fu_clipoffset(fu, frac, 0, 0);
>> + dc_fu_clipdimensions(fu, frac, 1, 1);
>> + dc_fu_disable_src_buf(fu, frac);
>> + dc_fu_set_pixel_blend_mode(fu, frac);
>> + }
>> +}
>> +
>
> [...]
>
>> +enum dc_link_id dc_lb_get_link_id(struct dc_lb *lb)
>> +{
>> + return lb->link;
>> +}
>> +
>> +void dc_lb_pec_dynamic_prim_sel(struct dc_lb *lb, enum dc_link_id prim)
>> +{
>> + int fixed_sels_num = ARRAY_SIZE(prim_sels) - 4;
>> + int i;
>> +
>> + for (i = 0; i < fixed_sels_num + lb->id; i++) {
>
> This function and the next one silently skip writing link ID if it is
> incorrect. Can it actually become incorrect? If not, I'd say, it is
> better to drop the loop and the array. If you are not sure, there should
> be some kind of dev_warn() or drm_warn().
Will add a dev_warn() in this and the next function in case prim/sec arguments
are invalid.
>
>> + if (prim_sels[i] == prim) {
>> + regmap_write_bits(lb->reg_pec, PIXENGCFG_DYNAMIC,
>> + PIXENGCFG_DYNAMIC_PRIM_SEL_MASK,
>> + PIXENGCFG_DYNAMIC_PRIM_SEL(prim));
>> + return;
>> + }
>> + }
>> +}
>> +
>> +void dc_lb_pec_dynamic_sec_sel(struct dc_lb *lb, enum dc_link_id sec)
>> +{
>> + int i;
>> +
>> + for (i = 0; i < ARRAY_SIZE(sec_sels); i++) {
>> + if (sec_sels[i] == sec) {
>> + regmap_write_bits(lb->reg_pec, PIXENGCFG_DYNAMIC,
>> + PIXENGCFG_DYNAMIC_SEC_SEL_MASK,
>> + PIXENGCFG_DYNAMIC_SEC_SEL(sec));
>> + return;
>> + }
>> + }
>> +}
>> +
>
> [...]
>
>> +
>> +static int dc_lb_bind(struct device *dev, struct device *master, void *data)
>> +{
>> + struct platform_device *pdev = to_platform_device(dev);
>> + struct dc_drm_device *dc_drm = data;
>> + struct dc_pe *pe = dc_drm->pe;
>> + void __iomem *base_pec;
>> + void __iomem *base_cfg;
>> + struct dc_lb *lb;
>> +
>> + lb = devm_kzalloc(dev, sizeof(*lb), GFP_KERNEL);
>> + if (!lb)
>> + return -ENOMEM;
>> +
>> + lb->id = (enum dc_lb_id)(uintptr_t)device_get_match_data(dev);
>> +
>> + base_pec = devm_platform_ioremap_resource_byname(pdev, "pec");
>> + if (IS_ERR(base_pec))
>> + return PTR_ERR(base_pec);
>> +
>> + base_cfg = devm_platform_ioremap_resource_byname(pdev, "cfg");
>> + if (IS_ERR(base_cfg))
>> + return PTR_ERR(base_cfg);
>> +
>> + lb->reg_pec = devm_regmap_init_mmio(dev, base_pec,
>> + &dc_lb_pec_regmap_config);
>> + if (IS_ERR(lb->reg_pec))
>> + return PTR_ERR(lb->reg_pec);
>> +
>> + lb->reg_cfg = devm_regmap_init_mmio(dev, base_cfg,
>> + &dc_lb_cfg_regmap_config);
>> + if (IS_ERR(lb->reg_cfg))
>> + return PTR_ERR(lb->reg_cfg);
>> +
>> + lb->link = lb_links[lb->id];
>
> lb->link = LINK_ID_LAYERBLEND0 + lb->id ?
Ack.
>
>> +
>> + pe->lb[lb->id] = lb;
>> +
>> + return 0;
>> +}
>> +
>> +static const struct component_ops dc_lb_ops = {
>> + .bind = dc_lb_bind,
>> +};
>> +
>
--
Regards,
Liu Ying
next prev parent reply other threads:[~2024-12-24 6:47 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-23 6:41 [PATCH v7 00/19] Add Freescale i.MX8qxp Display Controller support Liu Ying
2024-12-23 6:41 ` [PATCH v7 01/19] dt-bindings: display: imx: Add i.MX8qxp Display Controller processing units Liu Ying
2024-12-23 6:41 ` [PATCH v7 02/19] dt-bindings: display: imx: Add i.MX8qxp Display Controller blit engine Liu Ying
2024-12-23 6:41 ` [PATCH v7 03/19] dt-bindings: display: imx: Add i.MX8qxp Display Controller display engine Liu Ying
2024-12-23 10:26 ` Dmitry Baryshkov
2024-12-24 5:57 ` Liu Ying
2024-12-24 6:37 ` Dmitry Baryshkov
2024-12-24 7:04 ` Liu Ying
2024-12-23 6:41 ` [PATCH v7 04/19] dt-bindings: display: imx: Add i.MX8qxp Display Controller pixel engine Liu Ying
2024-12-23 6:41 ` [PATCH v7 05/19] dt-bindings: display: imx: Add i.MX8qxp Display Controller AXI performance counter Liu Ying
2024-12-23 6:41 ` [PATCH v7 06/19] dt-bindings: display: imx: Add i.MX8qxp Display Controller command sequencer Liu Ying
2024-12-23 6:41 ` [PATCH v7 07/19] dt-bindings: interrupt-controller: Add i.MX8qxp Display Controller interrupt controller Liu Ying
2024-12-23 6:41 ` [PATCH v7 08/19] dt-bindings: display: imx: Add i.MX8qxp Display Controller Liu Ying
2024-12-23 6:41 ` [PATCH v7 09/19] drm/imx: Add i.MX8qxp Display Controller display engine Liu Ying
2024-12-23 10:51 ` Dmitry Baryshkov
2024-12-24 6:22 ` Liu Ying
2024-12-24 6:44 ` Dmitry Baryshkov
2024-12-24 8:26 ` Liu Ying
2024-12-24 6:26 ` Liu Ying
2024-12-23 6:41 ` [PATCH v7 10/19] drm/imx: Add i.MX8qxp Display Controller pixel engine Liu Ying
2024-12-23 11:15 ` Dmitry Baryshkov
2024-12-24 6:47 ` Liu Ying [this message]
2024-12-23 6:41 ` [PATCH v7 11/19] drm/imx: Add i.MX8qxp Display Controller interrupt controller Liu Ying
2024-12-23 11:17 ` Dmitry Baryshkov
2024-12-23 6:41 ` [PATCH v7 12/19] drm/imx: Add i.MX8qxp Display Controller KMS Liu Ying
2024-12-23 11:32 ` Dmitry Baryshkov
2024-12-25 7:19 ` Liu Ying
2024-12-26 20:19 ` Dmitry Baryshkov
2024-12-30 1:50 ` Liu Ying
2024-12-23 6:41 ` [PATCH v7 13/19] MAINTAINERS: Add maintainer for i.MX8qxp Display Controller Liu Ying
2024-12-23 6:41 ` [DO NOT MERGE PATCH v7 14/19] dt-bindings: phy: mixel, mipi-dsi-phy: Allow assigned-clock* properties Liu Ying
2024-12-23 6:41 ` [DO NOT MERGE PATCH v7 15/19] dt-bindings: firmware: imx: Add SCU controlled display pixel link nodes Liu Ying
2024-12-23 6:41 ` [DO NOT MERGE PATCH v7 16/19] arm64: dts: imx8qxp: Add display controller subsystem Liu Ying
2024-12-23 6:41 ` [DO NOT MERGE PATCH v7 17/19] arm64: dts: imx8qxp: Add MIPI-LVDS combo subsystems Liu Ying
2024-12-23 6:41 ` [DO NOT MERGE PATCH v7 18/19] arm64: dts: imx8qxp-mek: Enable display controller Liu Ying
2024-12-23 6:41 ` [DO NOT MERGE PATCH v7 19/19] arm64: dts: imx8qxp-mek: Add MX8-DLVDS-LCD1 display module support Liu Ying
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=214b2282-fc83-4a25-8cf3-ce2b57b59eae@nxp.com \
--to=victor.liu@nxp.com \
--cc=agx@sigxcpu.org \
--cc=airlied@gmail.com \
--cc=aisheng.dong@nxp.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=festevam@gmail.com \
--cc=francesco@dolcini.it \
--cc=frank.li@nxp.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=kishon@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=simona@ffwll.ch \
--cc=tglx@linutronix.de \
--cc=tzimmermann@suse.de \
--cc=u.kleine-koenig@baylibre.com \
--cc=vkoul@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
all inboxes | Powered by JetHome®