Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3040047rdg; Tue, 17 Oct 2023 02:45:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFeEuhEFwbFsv2wY8SQYx1DgkuIvNqUDbvXA3f+hwTUdE/6xhILUHd/+rBOWTHWgiRtrwNe X-Received: by 2002:a05:6808:2028:b0:3b2:dc66:2170 with SMTP id q40-20020a056808202800b003b2dc662170mr582835oiw.19.1697535950203; Tue, 17 Oct 2023 02:45:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697535950; cv=none; d=google.com; s=arc-20160816; b=zfbyn1HaHn5uqV+vqmEL3OnL6ax4ymNpN1Kb0s0ytR38Qa0YA/onIZubQ8gsuoPo0I Jgwf1KE8R5QhvT3/7V9aiPDyZ8sziwzCPbzeNhSsQbPsbtYrf5sFbmbO2wQAzfHimOjw 8cwrihEBQwXPCZKHSepHdR8kZnS96x1hGMzsvBdey5vziaA3tsgFFZidC/xU8pq2f7A8 YR7wK2WiwrrPXEeHcuLXIZPljgiJxMBq2p6e1HrkrcW1II2jj4nSblYfMMBWs1NHFyV7 oXuDK38OjXmVKO6HybvC9JdaMpYN1x7OQO5TDJYZNuaXKr0e6d9nehhs6bkinhXrBi07 4XkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=tPfuw6zuo4G0EF6TuYra8R/f9MqARSfPI2NFct17PMY=; fh=W34SOItl1lj8wl9YrT4TiuLL50OQcdfIb7Xa0dpmCs0=; b=sEzk5EdwTXlY9CNJP6unmISqUiY3sjc0VZ6Jr7k7E4K4rXZXpw4XYRdOGeQ1C55xV7 xwsYTmSmy/4BiiLpcOakRoO1uoeBijNBLF3T4exPIipQc3WkFiM/Ig2qgCXiVQeBF2VH yns7OIONn1QTT7Wcrl1M/mdBnMO9yeJzKx6s0pdE+Zm+O0qRScUk6B5jzUlWUYztB/p1 Qbmfe9uao3axV+hh315zEFeqbjDLeRKzn7pjSXOxiWlsevhs+lxxogpJyvSj15G0UOWq +xm89tv66DfF290kwxzbKqlKu2vBRO7MkisvOFnbnMHRrglAP0mcnkWQwbyHfjSylV+O 4WhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=fhBYPuhB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id l195-20020a633ecc000000b00578b37ad24bsi1405028pga.619.2023.10.17.02.45.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 02:45:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=fhBYPuhB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 26A75807E790; Tue, 17 Oct 2023 02:45:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234920AbjJQJpA (ORCPT + 99 others); Tue, 17 Oct 2023 05:45:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234812AbjJQJo7 (ORCPT ); Tue, 17 Oct 2023 05:44:59 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5836E98; Tue, 17 Oct 2023 02:44:57 -0700 (PDT) Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id D078C66072C1; Tue, 17 Oct 2023 10:44:54 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1697535896; bh=yx63KVkLH1o5DUDZrBN8lhi6q9U2dwYv3+7BafhDl/U=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=fhBYPuhBEtzpRp8x1vGX0Aem3Kl+EavYbolJeARnW6Jo5YX2MDLi/WNr4YHowVz7I Ae+Kqn26gGeNmFgXpyR7X9Y6drMEP56VeFSWacFgta4LUfV/T7B1rF0iGStwsfdLVq digqRgI1QMqHEcG0qRuFO6PTsS93pgCoMdYZ4YIUHzR8Svqjq7rWDzjyJqnIn7hjh+ uVgLWwpQJ5CHEtoQH8CTRRGeElXJIRHaCXQJhO9MoCBbnkGf351bELWqCb+1oNyfiC wPW0iv0+qjx2p432tMJxdGxOP1SVSPNwKIe8UPx7NMppGekMvGQDyFr9foGuj6cAaF HuueE8FaPYUBw== Message-ID: Date: Tue, 17 Oct 2023 11:44:52 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v8 17/23] drm/mediatek: Support MT8188 Padding in display driver Content-Language: en-US To: Hsiao Chien Sung , CK Hu , Krzysztof Kozlowski , Matthias Brugger , Rob Herring Cc: Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , Fei Shao , Sean Paul , Johnson Wang , "Nancy . Lin" , Moudy Ho , "Jason-JH . Lin" , Nathan Lu , Yongqiang Niu , Hans Verkuil , Mauro Carvalho Chehab , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org References: <20231016104010.3270-1-shawn.sung@mediatek.com> <20231016104010.3270-18-shawn.sung@mediatek.com> From: AngeloGioacchino Del Regno In-Reply-To: <20231016104010.3270-18-shawn.sung@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 17 Oct 2023 02:45:07 -0700 (PDT) Il 16/10/23 12:40, Hsiao Chien Sung ha scritto: > Padding is a new display module on MT8188, it provides ability > to add pixels to width and height of a layer with specified colors. > > Due to hardware design, Mixer in VDOSYS1 requires width of a layer > to be 2-pixel-align, or 4-pixel-align when ETHDR is enabled, > we need Padding to deal with odd width. > > Signed-off-by: Hsiao Chien Sung > --- > drivers/gpu/drm/mediatek/Makefile | 3 +- > drivers/gpu/drm/mediatek/mtk_disp_drv.h | 4 + > drivers/gpu/drm/mediatek/mtk_drm_drv.c | 1 + > drivers/gpu/drm/mediatek/mtk_drm_drv.h | 2 +- > drivers/gpu/drm/mediatek/mtk_padding.c | 160 ++++++++++++++++++++++++ > 5 files changed, 168 insertions(+), 2 deletions(-) > create mode 100644 drivers/gpu/drm/mediatek/mtk_padding.c > > diff --git a/drivers/gpu/drm/mediatek/Makefile b/drivers/gpu/drm/mediatek/Makefile > index d4d193f60271..5e4436403b8d 100644 > --- a/drivers/gpu/drm/mediatek/Makefile > +++ b/drivers/gpu/drm/mediatek/Makefile > @@ -16,7 +16,8 @@ mediatek-drm-y := mtk_disp_aal.o \ > mtk_dsi.o \ > mtk_dpi.o \ > mtk_ethdr.o \ > - mtk_mdp_rdma.o > + mtk_mdp_rdma.o \ > + mtk_padding.o > > obj-$(CONFIG_DRM_MEDIATEK) += mediatek-drm.o > > diff --git a/drivers/gpu/drm/mediatek/mtk_disp_drv.h b/drivers/gpu/drm/mediatek/mtk_disp_drv.h > index bf06ccb65652..e2b602037ac3 100644 > --- a/drivers/gpu/drm/mediatek/mtk_disp_drv.h > +++ b/drivers/gpu/drm/mediatek/mtk_disp_drv.h > @@ -159,4 +159,8 @@ void mtk_mdp_rdma_config(struct device *dev, struct mtk_mdp_rdma_cfg *cfg, > const u32 *mtk_mdp_rdma_get_formats(struct device *dev); > size_t mtk_mdp_rdma_get_num_formats(struct device *dev); > > +int mtk_padding_clk_enable(struct device *dev); > +void mtk_padding_clk_disable(struct device *dev); > +void mtk_padding_start(struct device *dev); > +void mtk_padding_stop(struct device *dev); > #endif > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c > index cdce165c092e..62e6e9785443 100644 > --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c > +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c > @@ -1025,6 +1025,7 @@ static struct platform_driver * const mtk_drm_drivers[] = { > &mtk_dsi_driver, > &mtk_ethdr_driver, > &mtk_mdp_rdma_driver, > + &mtk_padding_driver, > }; > > static int __init mtk_drm_init(void) > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.h b/drivers/gpu/drm/mediatek/mtk_drm_drv.h > index 8dca68ea1b94..d2efd715699f 100644 > --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.h > +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.h > @@ -72,5 +72,5 @@ extern struct platform_driver mtk_dpi_driver; > extern struct platform_driver mtk_dsi_driver; > extern struct platform_driver mtk_ethdr_driver; > extern struct platform_driver mtk_mdp_rdma_driver; > - > +extern struct platform_driver mtk_padding_driver; > #endif /* MTK_DRM_DRV_H */ > diff --git a/drivers/gpu/drm/mediatek/mtk_padding.c b/drivers/gpu/drm/mediatek/mtk_padding.c > new file mode 100644 > index 000000000000..fa2e7fc9c7bd > --- /dev/null > +++ b/drivers/gpu/drm/mediatek/mtk_padding.c > @@ -0,0 +1,160 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* > + * Copyright (c) 2023 MediaTek Inc. > + */ > + ..snip.. > + > +static const struct of_device_id mtk_padding_driver_dt_match[] = { > + { .compatible = "mediatek,mt8188-padding" }, > + { /* sentinel */ } > +}; > +MODULE_DEVICE_TABLE(of, mtk_padding_driver_dt_match); > + > +struct platform_driver mtk_padding_driver = { > + .probe = mtk_padding_probe, > + .remove = mtk_padding_remove, > + .driver = { > + .name = "mediatek-padding", Please let's be consistent with the driver names, this should be "mediatek-disp-padding". After changing that, Reviewed-by: AngeloGioacchino Del Regno