Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2428566pxb; Sat, 30 Jan 2021 02:16:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJz8YXfIPv0I5iQEEWLqypNvoBJLbGH+eLwNdQyJ3SHUq8djjzWx6Ty2xv9tAKTURh80URHH X-Received: by 2002:a17:906:4a04:: with SMTP id w4mr8613805eju.46.1612001794050; Sat, 30 Jan 2021 02:16:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612001794; cv=none; d=google.com; s=arc-20160816; b=o1ocMV5OL8Gmpeqm03HRETexnUZT3p23qUSaoltMxHeJDQDkygks5aIJvMKFbhco3N dGE34rL8X7+IjZMlogyFJlaM7mW+YHyKF0Xyrci9PRHQjpv80fK+/BPbsB9wKIkL3YeK sL2F43tMvgv8SYfrj3VnD+3j/DOr1Py7zHoAsE5KWGdgjoWKAKWnZrgNbLqZATqw2Ex+ 2QSRCUmXyr3pImxSiNTUHtV1OGfRX+Z2ShpBvrmUDtWugbO1Z3O+on1zmSiEaLxMdNqE v7uwbEop+qbxhiVOkN1jH+lqU/dosWcgK+4ZxFr8cD00YdlsOjxWiXqeW2EjT8xu5yHd 2UXg== 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=39/kHHD2lPsY60weDqigTecqljPBfvHslf1oc3Jlt98=; b=ssUpX73eLc5bpQ0MEpgWXhwg0USrOv+Uya5fZ9Rq7oKmmQC/Ja7VAOytp1s1V2GOTT gU6/qtgL9Xf9VU6Lg5y+64jeUdKNctAFQ4kfi9/U32Lsd2UFp+CLM5iebr8RsbdeY1fh amUyCKf7uZ8A7hKFSJ315kmlOeQFTDtGW7lYY2RSHw5f8Par9oi3ZF+Bou+7hi42hUWs 2O/tIpojgD1IrFZLfRehXt3ImHSYa44oYm6dxMEdEOCkwYLY1pThN/wKO+TKi5khVl/m 9++kmiFC/hXbqJEveQKaItIIriwqIY8pOvEueaYcJy2JBIzkouiicwq7b0gozpcFSwHn WPmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sILany1Q; 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 l20si6299630ejx.471.2021.01.30.02.16.10; Sat, 30 Jan 2021 02:16:34 -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=sILany1Q; 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 S230112AbhA3KOa (ORCPT + 99 others); Sat, 30 Jan 2021 05:14:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:49430 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231817AbhA3KN1 (ORCPT ); Sat, 30 Jan 2021 05:13:27 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id AB9C964DE7; Sat, 30 Jan 2021 10:12:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612001567; bh=N5xKQ7D7bbQAxoHSV1A03B0Qf2d9erN8a0kxiDAMWXY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=sILany1Q3l1Jka8eKGJzp3yNvZKM0f5gBIlD0J+NN8OVmOWwd5eZi3uPadHSGgbuG zsswNk+/phPYZITk+uJtLtu6lBHIq+oBpyW8v7gzWruu/R/YPPQdcC15/OCILWtKnr ppC1cwLnxUKC3GmIXjXUTQzZcwa/57amfKpah9NeUlFcDMDSVkjNtmZmLrCaPH6Kpg ggVA7OrfefeR+w1mEaDGWQlT5AKhKBMprjTfINxohGWX9k95y+pd9/0hxLWA0uavXl 4QdOvq00nLCCxNoqBrKVyGepL7NVdbk3lzSKhqOJ3VssWOUl5MlGZUNxz+y+wBvfGR VtVQ5Oy3eXPzg== Received: by mail-ej1-f47.google.com with SMTP id w1so16602324ejf.11; Sat, 30 Jan 2021 02:12:46 -0800 (PST) X-Gm-Message-State: AOAM532/H3oKsFwntrIcAayC/H6jXjJgfRPVeMd+cfuBQrohexTAXwRE a8PRVJutBGe2ocM6x/7dziO0+NrhteLsogyE9Q== X-Received: by 2002:a17:906:ada:: with SMTP id z26mr8516170ejf.127.1612001565308; Sat, 30 Jan 2021 02:12:45 -0800 (PST) MIME-Version: 1.0 References: <20210129092209.2584718-1-hsinyi@chromium.org> <20210129092209.2584718-6-hsinyi@chromium.org> In-Reply-To: <20210129092209.2584718-6-hsinyi@chromium.org> From: Chun-Kuang Hu Date: Sat, 30 Jan 2021 18:12:32 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v13 5/8] drm/mediatek: add has_dither private data for gamma To: Hsin-Yi Wang Cc: CK Hu , Philipp Zabel , Matthias Brugger , Mark Rutland , DTML , Yongqiang Niu , David Airlie , linux-kernel , DRI Development , "moderated list:ARM/Mediatek SoC support" , Daniel Vetter , 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, Hsin-Yi: Hsin-Yi Wang =E6=96=BC 2021=E5=B9=B41=E6=9C=8829=E6= =97=A5 =E9=80=B1=E4=BA=94 =E4=B8=8B=E5=8D=885:23=E5=AF=AB=E9=81=93=EF=BC=9A > > From: Yongqiang Niu > > Not all SoC has dither function in gamma module. > Add private data to control this function setting. Applied to mediatek-drm-next [1], thanks. [1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/= log/?h=3Dmediatek-drm-next Regards, Chun-Kuang. > > Signed-off-by: Yongqiang Niu > Signed-off-by: Hsin-Yi Wang > Reviewed-by: CK Hu > --- > drivers/gpu/drm/mediatek/mtk_disp_gamma.c | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c b/drivers/gpu/drm/= mediatek/mtk_disp_gamma.c > index 6b520807921e3..5092a27ccc28b 100644 > --- a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c > +++ b/drivers/gpu/drm/mediatek/mtk_disp_gamma.c > @@ -27,7 +27,7 @@ > #define LUT_10BIT_MASK 0x03ff > > struct mtk_disp_gamma_data { > - u32 reserved; > + bool has_dither; > }; > > /** > @@ -93,8 +93,9 @@ void mtk_gamma_config(struct device *dev, unsigned int = w, > > mtk_ddp_write(cmdq_pkt, h << 16 | w, &gamma->cmdq_reg, gamma->reg= s, > DISP_GAMMA_SIZE); > - mtk_dither_set_common(gamma->regs, &gamma->cmdq_reg, bpc, DISP_GA= MMA_CFG, > - GAMMA_DITHERING, cmdq_pkt); > + if (gamma->data && gamma->data->has_dither) > + mtk_dither_set_common(gamma->regs, &gamma->cmdq_reg, bpc, > + DISP_GAMMA_CFG, GAMMA_DITHERING, cm= dq_pkt); > } > > void mtk_gamma_start(struct device *dev) > @@ -174,8 +175,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); > -- > 2.30.0.365.g02bc693789-goog > > > _______________________________________________ > Linux-mediatek mailing list > Linux-mediatek@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-mediatek