From patchwork Sun Jan 31 05:10:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 12057537 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9E79C433E0 for ; Sun, 31 Jan 2021 05:13:05 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8D27C64DCC for ; Sun, 31 Jan 2021 05:13:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8D27C64DCC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=TXTFR9dxQ7WMnZBHxhen5TWmOCwB29QrU93ZQYN6oeU=; b=d/sE2GNAzTNQBAzxcZcK/ffcrG pxXW35DTd9mBC1++jDy3G1NhE6a054bquJB+3V1dT5hAwweQX0znf8zpC+Ma5uiKrO/aMmFItUlDz BphBEMcuKZFyDQqTKdyozKmLqv4DPackWrmWjUitpofsh5Na0aP46eO3ND9iGJi8CZkozXdWF5JKs IFfVp4dYaE2p928zqNMuJtyKRUjApthZWzZC/aYBGMNz3dxfeQMSggrwKOA7yEBk5q+2g35xVDetX LRUt2aChFhpMGHlG1frNGt0vNsk59elkdAxhuLE28xmRwUR/FPBBcaKqeBZD40j1+mX+IN+P+jmnV pvXdRAxg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l650z-0004Xh-OF; Sun, 31 Jan 2021 05:11:13 +0000 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l650x-0004Wa-0w for linux-arm-kernel@lists.infradead.org; Sun, 31 Jan 2021 05:11:12 +0000 Received: by mail-pj1-x1031.google.com with SMTP id kx7so8392690pjb.2 for ; Sat, 30 Jan 2021 21:11:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=j678qJx/JPZkac4bEG/8rI07bilrUpTVTBhhwHGCLyE=; b=HVch7Qv7dq+iRZl0F7OTOFc01KRsOkitFn7szOaZ9AduniQxvk4XBoFLuthP8Kv6+0 Plhwxk/rCbQwhF4rXRcgnKJqGrjCIonm0eYQsveQ2gVikK3JsdbZbzJnH6djhj1w6gIn +KOVbeHocLUgCb2ZDLZ7kmf5WqLdirwI4T2OY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=j678qJx/JPZkac4bEG/8rI07bilrUpTVTBhhwHGCLyE=; b=En6TM4qquZEuy+vtpQ4rFGMvT5XAgjv28rYUc6TcRy0L89bYCjTDTmVmhcIz7JfTbB qE8q7ulieYvumB7rrgTICSdJfNWyL4Not9zHXmANpi1arhBulU97j82HSVT6LePvHrPN 3EwzfnNR0THIyrt5HBqb1tltTjOa1FdbndFS3R7JH9lcJYOxsR+E8vnOttZ4DbLrEFG9 a5ZqQ/9b+TWMxdf6GdgOeUX+Yi6ONAjHfwos2gYdk1kLzf4EMTJHQhXC0tji/s0LYKxl 5p2DjhQfaumTqR4HnQg3VuPaSRuGND2OrrinH1iO8WRrAnZw5SG/bxz3ImDD/oNcfhR+ Aivw== X-Gm-Message-State: AOAM5329ZYBnlJNmq8JJlgKCcS2ee0/iNeHCJ41VyO6oIUbuCo0FHb7f Vi/00+lSFlHihXRIyyfjW6Nwnw== X-Google-Smtp-Source: ABdhPJw5rGGPEQ8dqERgZpeHNpM1Tn38J69RC4BmBr0NM6uPyiS94+8Vq5WTIlas3qzw4/OIei1tzw== X-Received: by 2002:a17:90b:60c:: with SMTP id gb12mr11373176pjb.125.1612069865252; Sat, 30 Jan 2021 21:11:05 -0800 (PST) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:35ef:a870:bb74:2590]) by smtp.gmail.com with ESMTPSA id d22sm11470680pjv.11.2021.01.30.21.11.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Jan 2021 21:11:04 -0800 (PST) From: Hsin-Yi Wang To: CK Hu , Philipp Zabel , Matthias Brugger Subject: [PATCH] drm/mediatek: enable dither function Date: Sun, 31 Jan 2021 13:10:58 +0800 Message-Id: <20210131051058.3407985-1-hsinyi@chromium.org> X-Mailer: git-send-email 2.30.0.365.g02bc693789-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210131_001111_106110_A7A9EA63 X-CRM114-Status: GOOD ( 14.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Yongqiang Niu , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Daniel Vetter , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Yongqiang Niu Enable dither function to improve the display quality. Signed-off-by: Yongqiang Niu Signed-off-by: Hsin-Yi Wang Reviewed-by: Chun-Kuang Hu --- Previous version: https://patchwork.kernel.org/project/linux-mediatek/patch/20210129092209.2584718-7-hsinyi@chromium.org/ --- drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c index c730029ac8fc7..0444b429daf00 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c @@ -53,6 +53,7 @@ #define DITHER_EN BIT(0) #define DISP_DITHER_CFG 0x0020 #define DITHER_RELAY_MODE BIT(0) +#define DITHER_ENGINE_EN BIT(1) #define DISP_DITHER_SIZE 0x0030 #define LUT_10BIT_MASK 0x03ff @@ -315,8 +316,12 @@ static void mtk_dither_config(struct device *dev, unsigned int w, { struct mtk_ddp_comp_dev *priv = dev_get_drvdata(dev); - mtk_ddp_write(cmdq_pkt, h << 16 | w, &priv->cmdq_reg, priv->regs, DISP_DITHER_SIZE); - mtk_ddp_write(cmdq_pkt, DITHER_RELAY_MODE, &priv->cmdq_reg, priv->regs, DISP_DITHER_CFG); + mtk_ddp_write(cmdq_pkt, h << 16 | w, &priv->cmdq_reg, priv->regs, + DISP_DITHER_SIZE); + mtk_ddp_write(cmdq_pkt, DITHER_RELAY_MODE, &priv->cmdq_reg, priv->regs, + DISP_DITHER_CFG); + mtk_dither_set_common(priv->regs, &priv->cmdq_reg, bpc, DISP_DITHER_CFG, + DITHER_ENGINE_EN, cmdq_pkt); } static void mtk_dither_start(struct device *dev)