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: 126529 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1680723ljc; Thu, 1 Feb 2018 04:55:27 -0800 (PST) X-Google-Smtp-Source: AH8x225zBZbEURlA/KBP+0tW4ivQHV0l7BmTxOgMM9KZUf4UsgOgN52ktRjkh1t7m8ZljPhDxUxK X-Received: by 10.98.19.19 with SMTP id b19mr36957762pfj.118.1517489727717; Thu, 01 Feb 2018 04:55:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517489727; cv=none; d=google.com; s=arc-20160816; b=yhCdlLoSt2wZeBG99SV96dUvH6zrz1Y9p3cQXfv0U+D+HnrTArHnSOn6If7PrJS+Ah 1uKVMULDr3/ZWaisz0+b3E0I9rV07RNwDzwY+OGToQFIQFdmMpxNnhJ6rHpax7jr5Esa pmyD+BS3Bc0rPDSB15pEH9otVVJBZols2gjMvGAcLVsXdMLDmfIOMLp4N2gbGsSGqzmw 1EwoVpBjn0xtGHHpMEOoO8HHH3ViyhYzGPV3lxVsbq7rgCGC/b6PVc7+ttGlh01MRpi2 hSPHHD8Tc6lF5YlC8IMxp0BCxNMIfO3mGLrMSaKY0ZrUvGWziLkBpBAehiOqxfV3qcc3 6cmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=QzVCK00Dhw5oo4dGz13lCuIgS3uPNGot7/dVQO5jRfE=; b=vLdufQTW3bP2JIIxxf3a0jHCdLwCKz3v1mmZ+ZXYZSaM6bdTPNQ5l0ZvwNJD2AGlri dpsUeS+jItVE4RKLsxszw3lorBd09SEK0dar95gDaGWZhVA3EXnIkJVEstQn0Vg/GsoJ ebDedDgx8A33KrNtX2K/Figco0yvEneTtanYrND0a/yKNYnonGZbhvjVLN9+yItgrWb9 2lG5DFl/cWygtj+PYLgtTFdq1cEGwiVtmUdD2ozdIYf5koq0tu5KFqi0eQUp25VLnS+g wAMIuPGQ5eZQTLTsun/OhFVryGstDzir3YTTKVAyZtKl7DWtmkVvmTnu4pd5PbdsQpYR wsTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=WT9xdkJS; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id bj9-v6si1646262plb.464.2018.02.01.04.55.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Feb 2018 04:55:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=WT9xdkJS; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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-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" 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);