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: 126970 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp2745798ljc; Tue, 6 Feb 2018 01:36:23 -0800 (PST) X-Google-Smtp-Source: AH8x225D0Caix9BAToNRvh2R3Jo6a/DwaLIly6gxOV5+4fguft7M2Dzx9vRKa/u6yHaNdnvUN0Hz X-Received: by 2002:a17:902:968b:: with SMTP id n11-v6mr1836748plp.168.1517909783614; Tue, 06 Feb 2018 01:36:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517909783; cv=none; d=google.com; s=arc-20160816; b=bVC3fUn5hJ/VoEWxtbqdr4KBa6dnzMyWu2Fk1AFkvK71qFx1UwG5rOViSKC7/IjR0v d9FaZgI6JWp437iWUjzUN0S5IeDCjo2jz95GkqSBjbNbYdctHRX1UNvKL5qHnyVdmL25 6FZqQaodKgm6ETaqq13BEWZoMBoTi17v68q+lFa1mxiiiazvELSWI6DV8A9JqkUy6fNG xWNPLH1CGifMyO9sxVEBE3eksMW9/qDaYz8TvmPs1iNmjAMXjxhg2wM31T6Crq9RX7/X EjhSMd9Q5dZeln3u8jdlRyTpuFH9j9mnNxkeuonf8qGURcOJw1pZb+QtQcs7vf2zLIDY HDhg== 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=8+hXWjzw1Y0xvgJ/6zSOPQ3VYWbSnvCjtJhyjzIj+Zo=; b=WveUOEZpMLZ5P6Ild3wJEmqSd7s0uGZp/8c/VOr1jMUdvVQEgAuABFcU4rmiP4jUcq 62/K53KE+JN/Qm8weS9qVa7082+9sdibv6i2QQFATNWtJ3tpL2My0aMs3QRzDL4FoerN S/+gX8pNh/Un3nEUp1aiGEr9b4qsLG+JbELOi2BeJUzkKIyfGY1KnsvTZt3B3KdFj2Pb ceYWHK77Qu3SBua9wCWw5Mecr3mnbSjFfQYbKTLZXPGeCz+SE0qB09BMdgyEUVYAcodb Y8cjBUp6mvOZW8Qlu3y15hzRUC7fqMQdBgmYupoJIgwl8KGMh6YbCPQDSZp/i6Rjb10j gpFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=QFjzV/4M; 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 c24-v6si6044163plo.608.2018.02.06.01.36.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Feb 2018 01:36:23 -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=QFjzV/4M; 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 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-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" 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);