Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp199893pxu; Thu, 7 Jan 2021 02:31:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJyygkfOkrXk8gXw0Xi8wFN087BfO7pOPbeYibihyYxinoZm/KoJHyIIPTNuLvCodaxp7X2S X-Received: by 2002:a05:6402:1646:: with SMTP id s6mr1157447edx.319.1610015489281; Thu, 07 Jan 2021 02:31:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610015489; cv=none; d=google.com; s=arc-20160816; b=BmSun06k542SJRr7//pwq0ZD05IDZyKLi3dYNlf8vjI0+mce/WZaqDKdVXfC8H0y/l Zd156zwJ99Zz+STQSYgQ+Lnv8RzytYOOx9N6wG7xnSZ4dBGpWpqGvrqssH8ofg4DD6hJ acxEaCAYiokNxHYaCGLHZeQFV6jqKB0dOk5v7/PtYQowDMtpSw3nmtVTPpPZciN2Xu6U IKHZupAv0uEuVwODiaKSFVV15j+HXS+r8OiXlaZdrOTea9quXV5oTvI0juJJAC7YclmJ CPZ8liMpCGOgA7a1WLRDPjNIG/EYueOi6V1H6zLewi+foaCz9ANs/matX2PXt/M95Rr6 EBLw== 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=Xauc2j1Z93c/U4Ugvsr1mxwTGi4RYi+2t+hbo01U8kk=; b=iTS825h3frMvWWmWk3sNWFZSlBAGzIdZyG9p0hxJ/gAte0/tdwFUKP5UO4aGoNNVKP vGzTmv3LueGb2Xn0y/Yl4jxlSBQmctR+Yp1TBEsbGUe3D4RO7D+1DO5163Gf/rx9lTcJ XfhHkECm9kFW5ABQMRAzDy3hsDCvb2OrxnyQ8i4SLamLCGNyxH+WdCY0ylMWx8Re+HsS NARxGBQYJTFOz0zxVQLXBd819PWIglV3gUJRLKCT94pY7j15Qg5NdmVreNCRU1E422aT v94o96jvPEzdfajRMR1ZJyj9ldmcWXi7QVjupkNqM40uGE3Pd83PW2KE4GXzQISF3KH3 T9Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="PhzyKeH/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w8si1994793ejv.263.2021.01.07.02.31.05; Thu, 07 Jan 2021 02:31:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="PhzyKeH/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726514AbhAGKaL (ORCPT + 99 others); Thu, 7 Jan 2021 05:30:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:57166 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725974AbhAGKaK (ORCPT ); Thu, 7 Jan 2021 05:30:10 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id AD82923142; Thu, 7 Jan 2021 10:29:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610015370; bh=13M5zIZH8BYdSgLHcSiUssuxy7aGnL0zsfUTM4vT+Pc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=PhzyKeH/omMWDkne6YDBSmYzC952k4TKrqQ+OcU3RWV226x+kfHocirL+sOZ1Ec1I L6FYpSbXcq2asi3sfqgBi0QnTs03QoC98IdxSzGWTO41n/JYWqaq0o4k86z7HrC8Ie ilPmplMJtIaIQ3XygqQIoEY2Hyr24EGZ914HsqxKeELf1D8HedliDW2sGcd4JtwV2f vhoiv7NnQ9Sr4DIB5ghdCSrOkw132MTxao0h77BnA1+creB8OzggJAtOWa+zzsJxlD YyErySULnK2ZXXY8Pl9n4joMIK9fxLbho21bcscMsaf3/9mZzdDdy0IOYt5tLzvHwp 9lKjVFeYW7w2w== Received: by mail-ej1-f48.google.com with SMTP id n26so8989389eju.6; Thu, 07 Jan 2021 02:29:29 -0800 (PST) X-Gm-Message-State: AOAM533wEY4tge11YQP7IYg/wb8UlLuPZUAr3DQCPfLrq4kxRi0tP/7j +1sGTKdnnyWzDGdUy3LJny4mjxceW6NBGjAiQA== X-Received: by 2002:a17:907:9627:: with SMTP id gb39mr5843470ejc.267.1610015368212; Thu, 07 Jan 2021 02:29:28 -0800 (PST) MIME-Version: 1.0 References: <1609989081-29353-1-git-send-email-yongqiang.niu@mediatek.com> <1609989081-29353-9-git-send-email-yongqiang.niu@mediatek.com> In-Reply-To: <1609989081-29353-9-git-send-email-yongqiang.niu@mediatek.com> From: Chun-Kuang Hu Date: Thu, 7 Jan 2021 18:29:16 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v9, 08/11] drm/mediatek: add has_dither private data for gamma To: Yongqiang Niu Cc: CK Hu , Philipp Zabel , Rob Herring , Matthias Brugger , Mark Rutland , DTML , David Airlie , linux-kernel , DRI Development , Project_Global_Chrome_Upstream_Group@mediatek.com, "moderated list:ARM/Mediatek SoC support" , Daniel Vetter , Hsin-Yi Wang , Linux ARM Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Yongqiang: Yongqiang Niu =E6=96=BC 2021=E5=B9=B41=E6=9C= =887=E6=97=A5 =E9=80=B1=E5=9B=9B =E4=B8=8A=E5=8D=8811:12=E5=AF=AB=E9=81=93= =EF=BC=9A > > not all SoC has dither function in gamma module > dd private data to control this function setting 'add' ? > > Signed-off-by: Yongqiang Niu > --- > drivers/gpu/drm/mediatek/mtk_disp_gamma.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c b/drivers/gpu/drm/= mediatek/mtk_disp_gamma.c > index 8501821..4eab82a 100644 > --- a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c > +++ b/drivers/gpu/drm/mediatek/mtk_disp_gamma.c > @@ -24,7 +24,7 @@ > #define LUT_10BIT_MASK 0x03ff > > struct mtk_disp_gamma_data { > - u32 reserved; > + bool has_dither; > }; > > /** > @@ -72,7 +72,8 @@ static void mtk_gamma_config(struct mtk_ddp_comp *comp,= unsigned int w, > > mtk_ddp_write(cmdq_pkt, h << 16 | w, comp, DISP_GAMMA_SIZE); > > - mtk_dither_set(comp, bpc, DISP_GAMMA_CFG, cmdq_pkt); > + if (gamma->data && gamma->data->has_dither) > + mtk_dither_set(comp, bpc, DISP_GAMMA_CFG, cmdq_pkt); > } > > static void mtk_gamma_start(struct mtk_ddp_comp *comp) > @@ -168,8 +169,13 @@ static int mtk_disp_gamma_remove(struct platform_dev= ice *pdev) > return 0; > } > > +static const struct mtk_disp_gamma_data mt8173_gamma_driver_data =3D { > + .has_dither =3D true, > +}; > + > static const struct of_device_id mtk_disp_gamma_driver_dt_match[] =3D { > - { .compatible =3D "mediatek,mt8173-disp-gamma"}, > + { .compatible =3D "mediatek,mt8173-disp-gamma", > + .data =3D &mt8173_gamma_driver_data}, > {}, > }; > MODULE_DEVICE_TABLE(of, mtk_disp_gamma_driver_dt_match); > -- > 1.8.1.1.dirty > _______________________________________________ > Linux-mediatek mailing list > Linux-mediatek@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-mediatek