From patchwork Thu Feb 1 12:55:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 10195461 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 1FA4B60380 for ; Thu, 1 Feb 2018 12:55:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A9EB288DD for ; Thu, 1 Feb 2018 12:55:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F36AE2890A; Thu, 1 Feb 2018 12:55:27 +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 AD85F288DD for ; Thu, 1 Feb 2018 12:55:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 187F76EDA0; Thu, 1 Feb 2018 12:55:26 +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 66C616ED9C for ; Thu, 1 Feb 2018 12:55:24 +0000 (UTC) Received: by mail-lf0-x243.google.com with SMTP id a204so26058341lfa.2 for ; Thu, 01 Feb 2018 04:55:24 -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=cypPwjRTvq7HplaNcVDWNibx5OOOa+nccfWyv7fh2bA=; b=WT9xdkJSO6BiyclX4N6gmJV5b6nGawaOvGixq2k4d1d8dbX96O+Gwx5DYCCD5Kqd8R wSZse8aMdr2kYBxKOQEuaQ4kPobDNCDhoKbR2XDnDbHtQNytOpQ2sn8ET51Z6lA4db4I Ky+0cJho8y7hEBhh64BOszkrr+ly1ajQFoHDk= 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=cypPwjRTvq7HplaNcVDWNibx5OOOa+nccfWyv7fh2bA=; b=pkfaEM9SQChwYh9kIsZ1eeQjASv8dDg4EhhRexta5FLtqfz8knlDcjxzess2WL9a9M xPUJaZ0e/+QL2SshLKbTAB/lmVvTPLXHkec10gFVUU7fA1IjjXpJ699Z4t2364L/M0FL WFzJOGyAbhUpfU3w9pHgQZETGeO5u6+I/NFI6Z0cEERPIKY0Y6/rPkho5K2WMLUI5yjo P29H3jrkVDG15PBbHqPsWcIVEuRNlpiGxht/IxS/xRa4CcHholKxVCpFWHTMprDPdYN1 EJbzonxAAI8on5wkdqS2KPMZMJNslUhNupqwqK1mH1NuN96HDEnAKA4IQYoZZFg/Kh6k B44A== X-Gm-Message-State: AKwxytdX2nIkRx41RvrWac3x/6+NLLmxZgu8crbSDKkD23CBOPXOKpSs ilcaydWLM6QRI9M8Jy//ZmF3fQ== X-Google-Smtp-Source: AH8x22611AjKjkdMqBqbMxG9Er3BTYhIyouiPiR7WEG0XU4U/6W7TKr518y5rqwDPdw48zJoPB9ZdQ== X-Received: by 10.25.23.194 with SMTP id 63mr22987696lfx.100.1517489722546; Thu, 01 Feb 2018 04:55:22 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id a129sm4300792lfa.0.2018.02.01.04.55.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Feb 2018 04:55:21 -0800 (PST) From: Linus Walleij To: Daniel Vetter , Jani Nikula , Sean Paul , Eric Anholt Subject: [PATCH 2/5 v2] drm/pl111: Handle the Versatile RGB/BGR565 mode Date: Thu, 1 Feb 2018 13:55:10 +0100 Message-Id: <20180201125513.5482-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180201125513.5482-1-linus.walleij@linaro.org> References: <20180201125513.5482-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. Signed-off-by: Linus Walleij --- 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);