Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9295pxu; Wed, 6 Jan 2021 19:15:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJwmrNz21AE4oovh3op7FMZ7jeugKVUgNkLG+MaZ5G+38oIDXey8TTlQ5QjcHWjchF6XEzmx X-Received: by 2002:a17:906:4348:: with SMTP id z8mr4888524ejm.371.1609989326832; Wed, 06 Jan 2021 19:15:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609989326; cv=none; d=google.com; s=arc-20160816; b=C8dG/FDYBo6YdNAatjvxfcx8Ul5hgejuZMBebxESzMNkHpOYECiG7G+lIml6gkbQW2 E+qC9grsf7l+GCOYte1frUqVA+cX3mSsEl2Wmf+VRohIC9YNY9qsvlDQarW42HdsyrNI 0htkGxbiUHPg02Emq5+7MbYdurw3W18iChtfp41qkguUbtd2TzygNcVnNJft9mex6xrk Zdeu5gPkcfediHoLXwMVwLDLEAJt9tc2/f4VEhnPC1H5OUbBnPockNmxTsxUlPo8cxSd 0krDfKI8Ma4eQtV4iH/1A4CfQ+TZ0p2NnOqsUXSRtkONUpyrlZhWdPa/lx0tZQJYbaFx fF2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=RXdh+UbxqLzDtqfQ7x6n5a/qM92+lBg2T4Ju1eGl+6E=; b=Si3UPRphZVPZEUISDQB2jWtkyvs2WyyU5Hw3fD0QoYgSGsAHtY6BvuhWNN2gphFp9b 5cgOg3Pnt8P/Nu2CMxRHrC2jdKCC6wtWN+9uurhYmUfFrq7KvexW0NjFXxEsHdZKJzhM NloOc3xn4+MANn50Gd3780Jb8EjmW/281Ic9BNHclhpD1Szm7eMMf4Js4X8RI4pBigUy iiNQF+xNuW0hAvdUx+eeZ/n8BInmrBFYvdc/gx+Ae4I4qZ9Zgd7kn2989/xcC6hYiIel pbn5xUENTZyqDeu5Vbfzeybk/L74NjKv+rjF9YmVdnsCydW8OMukm8Cce4Gwp95iaxXy fo6g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o23si1679415edt.543.2021.01.06.19.15.01; Wed, 06 Jan 2021 19:15:26 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727103AbhAGDM3 (ORCPT + 99 others); Wed, 6 Jan 2021 22:12:29 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:44907 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726330AbhAGDM3 (ORCPT ); Wed, 6 Jan 2021 22:12:29 -0500 X-UUID: 629fe793e3764c14b77edd360c3d0b1b-20210107 X-UUID: 629fe793e3764c14b77edd360c3d0b1b-20210107 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 764407116; Thu, 07 Jan 2021 11:11:33 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs05n2.mediatek.inc (172.21.101.140) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 7 Jan 2021 11:11:31 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 7 Jan 2021 11:11:31 +0800 From: Yongqiang Niu To: CK Hu , Philipp Zabel , Rob Herring , Matthias Brugger CC: David Airlie , Daniel Vetter , Mark Rutland , , , , , , , Hsin-Yi Wang , Yongqiang Niu Subject: [PATCH v9, 08/11] drm/mediatek: add has_dither private data for gamma Date: Thu, 7 Jan 2021 11:11:18 +0800 Message-ID: <1609989081-29353-9-git-send-email-yongqiang.niu@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1609989081-29353-1-git-send-email-yongqiang.niu@mediatek.com> References: <1609989081-29353-1-git-send-email-yongqiang.niu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org not all SoC has dither function in gamma module dd private data to control this function setting 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_device *pdev) return 0; } +static const struct mtk_disp_gamma_data mt8173_gamma_driver_data = { + .has_dither = true, +}; + static const struct of_device_id mtk_disp_gamma_driver_dt_match[] = { - { .compatible = "mediatek,mt8173-disp-gamma"}, + { .compatible = "mediatek,mt8173-disp-gamma", + .data = &mt8173_gamma_driver_data}, {}, }; MODULE_DEVICE_TABLE(of, mtk_disp_gamma_driver_dt_match); -- 1.8.1.1.dirty