From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1895BC433EF for ; Mon, 28 Mar 2022 08:33:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239394AbiC1Ifd (ORCPT ); Mon, 28 Mar 2022 04:35:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239395AbiC1Ifc (ORCPT ); Mon, 28 Mar 2022 04:35:32 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55FBD1EAF1; Mon, 28 Mar 2022 01:33:51 -0700 (PDT) X-UUID: a2d4b8aa5759442f913ec94d529a8a35-20220328 X-UUID: a2d4b8aa5759442f913ec94d529a8a35-20220328 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1793699260; Mon, 28 Mar 2022 16:33:47 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 28 Mar 2022 16:33:45 +0800 Received: from mtksdccf07 (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 28 Mar 2022 16:33:45 +0800 Message-ID: <0f893e050e46f8d9ea9c5a962b517638771203a0.camel@mediatek.com> Subject: Re: [PATCH v9 10/22] drm/mediatek: dpi: move dimension mask to SoC config From: Rex-BC Chen To: Guillaume Ranquet , , , , , , , , , , , , , , , , , CC: , , , , , , , Date: Mon, 28 Mar 2022 16:33:45 +0800 In-Reply-To: <20220327223927.20848-11-granquet@baylibre.com> References: <20220327223927.20848-1-granquet@baylibre.com> <20220327223927.20848-11-granquet@baylibre.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org On Mon, 2022-03-28 at 00:39 +0200, Guillaume Ranquet wrote: > Add flexibility by moving the dimension mask to the SoC config > > Signed-off-by: Guillaume Ranquet > Reviewed-by: AngeloGioacchino Del Regno < > angelogioacchino.delregno@collabora.com> > --- > drivers/gpu/drm/mediatek/mtk_dpi.c | 26 ++++++++++++++++---------- > 1 file changed, 16 insertions(+), 10 deletions(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c > b/drivers/gpu/drm/mediatek/mtk_dpi.c > index 454f8563efae..bf098f36a466 100644 > --- a/drivers/gpu/drm/mediatek/mtk_dpi.c > +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c > @@ -127,6 +127,8 @@ struct mtk_dpi_conf { > u32 num_output_fmts; > bool is_ck_de_pol; > bool swap_input_support; > + /* Mask used for HWIDTH, HPORCH, VSYNC_WIDTH and VSYNC_PORCH > (no shift) */ > + u32 dimension_mask; > const struct mtk_dpi_yc_limit *limit; > }; > > @@ -156,30 +158,30 @@ static void mtk_dpi_disable(struct mtk_dpi > *dpi) > static void mtk_dpi_config_hsync(struct mtk_dpi *dpi, > struct mtk_dpi_sync_param *sync) > { > - mtk_dpi_mask(dpi, DPI_TGEN_HWIDTH, > - sync->sync_width << HPW, HPW_MASK); > - mtk_dpi_mask(dpi, DPI_TGEN_HPORCH, > - sync->back_porch << HBP, HBP_MASK); > + mtk_dpi_mask(dpi, DPI_TGEN_HWIDTH, sync->sync_width << HPW, > + dpi->conf->dimension_mask << HPW); > + mtk_dpi_mask(dpi, DPI_TGEN_HPORCH, sync->back_porch << HBP, > + dpi->conf->dimension_mask << HBP); > mtk_dpi_mask(dpi, DPI_TGEN_HPORCH, sync->front_porch << HFP, > - HFP_MASK); > + dpi->conf->dimension_mask << HFP); > } > > static void mtk_dpi_config_vsync(struct mtk_dpi *dpi, > struct mtk_dpi_sync_param *sync, > u32 width_addr, u32 porch_addr) > { > - mtk_dpi_mask(dpi, width_addr, > - sync->sync_width << VSYNC_WIDTH_SHIFT, > - VSYNC_WIDTH_MASK); > mtk_dpi_mask(dpi, width_addr, > sync->shift_half_line << VSYNC_HALF_LINE_SHIFT, > VSYNC_HALF_LINE_MASK); > + mtk_dpi_mask(dpi, width_addr, > + sync->sync_width << VSYNC_WIDTH_SHIFT, > + dpi->conf->dimension_mask << VSYNC_WIDTH_SHIFT); > mtk_dpi_mask(dpi, porch_addr, > sync->back_porch << VSYNC_BACK_PORCH_SHIFT, > - VSYNC_BACK_PORCH_MASK); > + dpi->conf->dimension_mask << > VSYNC_BACK_PORCH_SHIFT); > mtk_dpi_mask(dpi, porch_addr, > sync->front_porch << VSYNC_FRONT_PORCH_SHIFT, > - VSYNC_FRONT_PORCH_MASK); > + dpi->conf->dimension_mask << > VSYNC_FRONT_PORCH_SHIFT); > } > > static void mtk_dpi_config_vsync_lodd(struct mtk_dpi *dpi, > @@ -813,6 +815,7 @@ static const struct mtk_dpi_conf mt8173_conf = { > .num_output_fmts = ARRAY_SIZE(mt8173_output_fmts), > .is_ck_de_pol = true, > .swap_input_support = true, > + .dimension_mask = HPW_MASK, > .limit = &mtk_dpi_limit, > }; > > @@ -825,6 +828,7 @@ static const struct mtk_dpi_conf mt2701_conf = { > .num_output_fmts = ARRAY_SIZE(mt8173_output_fmts), > .is_ck_de_pol = true, > .swap_input_support = true, > + .dimension_mask = HPW_MASK, > .limit = &mtk_dpi_limit, > }; > > @@ -836,6 +840,7 @@ static const struct mtk_dpi_conf mt8183_conf = { > .num_output_fmts = ARRAY_SIZE(mt8183_output_fmts), > .is_ck_de_pol = true, > .swap_input_support = true, > + .dimension_mask = HPW_MASK, > .limit = &mtk_dpi_limit, > }; > > @@ -847,6 +852,7 @@ static const struct mtk_dpi_conf mt8192_conf = { > .num_output_fmts = ARRAY_SIZE(mt8173_output_fmts), > .is_ck_de_pol = true, > .swap_input_support = true, > + .dimension_mask = HPW_MASK, > .limit = &mtk_dpi_limit, > }; > Reviewed-by: Rex-BC Chen