From patchwork Tue Feb 6 09:35:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 10202553 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2FF9D6020F for ; Tue, 6 Feb 2018 09:35:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D27D28AB9 for ; Tue, 6 Feb 2018 09:35:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21D7028AC1; Tue, 6 Feb 2018 09:35:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B116728AB9 for ; Tue, 6 Feb 2018 09:35:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1B86E6E3CC; Tue, 6 Feb 2018 09:35:52 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x243.google.com (mail-lf0-x243.google.com [IPv6:2a00:1450:4010:c07::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 83DAB6E3CC for ; Tue, 6 Feb 2018 09:35:50 +0000 (UTC) Received: by mail-lf0-x243.google.com with SMTP id v188so1732644lfa.11 for ; Tue, 06 Feb 2018 01:35:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EqwBE8CLCCA2Ayav7WE9l0FTEdiEt2ZX9LyCHlUq6WI=; b=QFjzV/4M0lv+HsZMiXQTxXx2ZYn+ADK7ymjaRz3bE8kJY+bGvnZhO0XivjCKfKIjgq StbxsZfPJ/QPdothiXkif7ZXU33Yl0gcegrhKklTIBRg2LikdAoSI4Svzsinzefbj1k+ OElKUy+DynR1mB58mMvla7J7QBFsx6AXxdHs4= 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:in-reply-to :references; bh=EqwBE8CLCCA2Ayav7WE9l0FTEdiEt2ZX9LyCHlUq6WI=; b=MZVOr/3gIPV7bLzbloK3T9NrUWm91nMjdpSfmldhqDCzkZn6By9kPhG4dYrGSvc5LN dl+juY2QX6bZVu8lBgoO590ijL1JwwgaLW34t4oogOV1mVERdSKwVda7qUqT4xiQNQ6S 2IIC2aWCYyVSnTtG1T4aJ5HlI7XzrId0B2Va3EFNgtF5OuJDU3tj5WDOfciEFIRD3y/M Od52kC5/gLLy1w9nDYuhwBenU3ED7LmtFjq8PZvFF8KnZrmXevzxOdAMRKmmGoxaby/I zmb3PhaO+ayspGifyj9osCDK2M2l+KqN0lFmDS85c8JCTiHKUuM3+33QNt0y/ftuJJo0 EqAg== X-Gm-Message-State: APf1xPBOF/wB1CIwBcSC/Hkq2RxxPG4K82rah/t5WyCBFegLRccQz0sa wPDPLUKdQvb9i2FhyFie8pjJxg== X-Google-Smtp-Source: AH8x2261pwYpc0KZ3sNB6/31Wye5t/zufeDhdh5GrWatHZg+d7kt88TFaGQ1iVbhNtkNws3kZ6oodw== X-Received: by 10.25.121.21 with SMTP id u21mr1200102lfc.79.1517909749001; Tue, 06 Feb 2018 01:35:49 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id m129sm2253675lfg.75.2018.02.06.01.35.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Feb 2018 01:35:48 -0800 (PST) From: Linus Walleij To: Daniel Vetter , Jani Nikula , Sean Paul , Eric Anholt Subject: [PATCH 2/5 v3] drm/pl111: Handle the Versatile RGB/BGR565 mode Date: Tue, 6 Feb 2018 10:35:37 +0100 Message-Id: <20180206093540.8147-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180206093540.8147-1-linus.walleij@linaro.org> References: <20180206093540.8147-1-linus.walleij@linaro.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The ARM Versatile series can do RGB/BGR565 with an external "PLD" (Programmable Logical Device). However the CLCD does not have control bits for this, so it needs to be set into the ordinary 16BPP mode, then the RGB/BGR565 handling of the pixel data is handled by configuring the PLD through the external register. Reviewed-by: Eric Anholt Signed-off-by: Linus Walleij --- ChangeLog v2->v3: - Collect Eric's Review tag. ChangeLog v1->v2: - Rebase on earlier changes. --- drivers/gpu/drm/pl111/pl111_display.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c index 7fe4040aea46..55ada00ec974 100644 --- a/drivers/gpu/drm/pl111/pl111_display.c +++ b/drivers/gpu/drm/pl111/pl111_display.c @@ -199,10 +199,17 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe, cntl |= CNTL_LCDBPP24 | CNTL_BGR; break; case DRM_FORMAT_BGR565: - cntl |= CNTL_LCDBPP16_565; + if (priv->variant->is_pl110) + cntl |= CNTL_LCDBPP16; + else + cntl |= CNTL_LCDBPP16_565; break; case DRM_FORMAT_RGB565: - cntl |= CNTL_LCDBPP16_565 | CNTL_BGR; + if (priv->variant->is_pl110) + cntl |= CNTL_LCDBPP16; + else + cntl |= CNTL_LCDBPP16_565; + cntl |= CNTL_BGR; break; case DRM_FORMAT_ABGR1555: case DRM_FORMAT_XBGR1555: @@ -226,6 +233,10 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe, break; } + /* The PL110 in Integrator/Versatile does the BGR routing externally */ + if (priv->variant->external_bgr) + cntl &= ~CNTL_BGR; + /* Power sequence: first enable and chill */ writel(cntl, priv->regs + priv->ctrl);