Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp893137lqj; Mon, 3 Jun 2024 04:22:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUkflvUhI8eiSppqtDiFCat3ZXNkk15YQgSxv0uHOEbk+DWRikj0C/3U4jJJZRUm3eu9xZhMLdW97Azu8O0dGMF0+iIP82/N64d/JMbOA== X-Google-Smtp-Source: AGHT+IGaajtJKtHSF6h+ZPVcfbrbO6Fs5RE21msDeMBEHsq/bqdj7tnanC+XJMa5eI+sS1li7Xly X-Received: by 2002:a17:906:4ed0:b0:a68:fafb:a16e with SMTP id a640c23a62f3a-a68fafbab12mr190802966b.4.1717413745892; Mon, 03 Jun 2024 04:22:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717413745; cv=pass; d=google.com; s=arc-20160816; b=aipCI4PUOTkLtCyvkvEbQhfs/f+zowJFk2vkaMMmEYMXwQu7snBm02m7M60G1aONzF hOmm7+1TBOhFLkU6+Cwqu0o+/psqGLv1u292iAPPmE9hS+OehRJGktktShXe19gHFjbx 8Tp6h7t7ZNRwMi4wSjFdjEnTyMTg9bgYYUFy4hyNL0HwMQ6F3i+AvcyQYu9wd4GMd8Yn EbhrJL2xDzRESj3FqlIFUBdxSW+9xbrwlPo68SjdgJpPLbBn4igsyzbixoJMudxFRvck OTbGVaIiafqrcLIJfUuN5sc7MRDVf2cOV2lGJdjuDYu6G3FbVVaIUDOk7QihEgLk4SSq ovig== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=gPzTGh56/k6GTttueUTyND9igLhniv+iDG93XfB760Q=; fh=Qca4uQclYGuGPeDwTz2ScN6SL0ZrdS/m01vAP+BwSac=; b=Chk8AN0nDMb3hXF+OIQqdrCZAvP86weI1FSllm5tND98Xu2FCPLItN7toqZpDMBME6 q5vy4qzO9m4hPTcGObIjxcIpcSuHoVASWV/ksET2NTxVbyP9mIaChGQvxVkD6ZuvgK/T HhNH4HM5Qa2vWFW6nVYK4I6DK/TGjEIcVGQlIYa1nxsnTRat9AlcUcr7C8xHZg+7yWzS zZSEVuj7pfv6rZvJqgFkrSuAuiLxW3obuQXZsY809yDI292NZukYb2Lh9g8YK4j5UM9p G/bPW2iSgmOAXH2JZrSBCvKwNbkkA2h/jNVRwiVqGkhEJMPYRxfo44Nsd6rydo1Twxpr Jhrg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HHaUDtyi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-199038-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199038-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a68fcd9dab6si131644966b.945.2024.06.03.04.22.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 04:22:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199038-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HHaUDtyi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-199038-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199038-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 642911F229C8 for ; Mon, 3 Jun 2024 11:22:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1EE6484E0C; Mon, 3 Jun 2024 11:21:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HHaUDtyi" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F07482887; Mon, 3 Jun 2024 11:21:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717413716; cv=none; b=crOBK4PSBWdAuM5hn5coVim24OXIn0ts59irzTSNgJlU5ONo/L++V0sNfyRek1HzoiAqVGyGM8GiB1ihTyUf6AMX7jUk4luw0OmD3EYtDUJtsyNp/cRnwr28+yTkPo93xZL/DqEIIfvRqigrTrY9PJxVnCTb0NNr52USAfMpCZU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717413716; c=relaxed/simple; bh=gNH7o0uB5n2M8ruKL+VTu1X79iL62sffpOhlGco74wk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZLxwjqLhI06LHdo91zpcN5RsSMjTxmSIVDq0VwkyeIkYRJ1yC2GmpmdB9c6rLT+rQ6PS/etgFwD4Soo/RtyjbtveeOH72yZsl4dxLcxDrJjgvplW1B0eVJwiOYGTIv1vbRgP8fUoSzZR+IDlX0ZpK/v5ZgqeXubhza1L+P8HTEA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HHaUDtyi; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 8F137C32789; Mon, 3 Jun 2024 11:21:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717413715; bh=gNH7o0uB5n2M8ruKL+VTu1X79iL62sffpOhlGco74wk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=HHaUDtyizsjTRoCz/94lHKMhepKrfZzT4eyuBt7y3PA4Hm/RLqotW9BQ7lfQrlViH EAGuTdjHCVBv2dvYXs+jxMd5ZsqPADjzDYI1QbaoSNidIHfsyd2qOtB4iUvvjhgvpV 8EL8TNXmHBDdQvpDsNQvAKpInuktTcjMewmoZYu0t80SF+6Pi/242KM07OS/EzlgPq y/MvzGJ0lyk2WR2fhRFiid3YUYcV2KZuQnMzz/Obd6bF9qAA4lYV/vBnzJm38h2GBt q2r6qY/whvxlXUZ0ifJQGpFauI49trgwLBOb+wwmyxLJJdFStRnMcabY2hpXdY0JTp UmBJu59Yg8LPQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78170C25B75; Mon, 3 Jun 2024 11:21:55 +0000 (UTC) From: =?utf-8?q?Noralf_Tr=C3=B8nnes_via_B4_Relay?= Date: Mon, 03 Jun 2024 13:21:32 +0200 Subject: [PATCH v3 1/5] dt-bindings: display: panel: mipi-dbi-spi: Add a pixel format property Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20240603-panel-mipi-dbi-rgb666-v3-1-59ed53ca73da@tronnes.org> References: <20240603-panel-mipi-dbi-rgb666-v3-0-59ed53ca73da@tronnes.org> In-Reply-To: <20240603-panel-mipi-dbi-rgb666-v3-0-59ed53ca73da@tronnes.org> To: Neil Armstrong , Jessica Zhang , Sam Ravnborg , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , David Lechner Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Kamlesh Gurudasani , Tommaso Merciai , =?utf-8?q?Noralf_Tr=C3=B8nnes?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1717413714; l=4065; i=noralf@tronnes.org; s=20221122; h=from:subject:message-id; bh=rqNvjdSCUsjKcYeeCETT/jnXy2Sa85ePgrIqrhCdz9A=; b=KfEmNiuP8/F5Bf1ISjNKur1+rckhTra3cwSqtCnHVF15L0X0pppQLet79ChGwcmiHEBMPLSeq rzza6UFJCICAaJlxw9tGvv8HUciLjAHzl30hpr3qpTyK3LMZzaGaLdO X-Developer-Key: i=noralf@tronnes.org; a=ed25519; pk=0o9is4iddvvlrY3yON5SVtAbgPnVs0LfQsjfqR2Hvz8= X-Endpoint-Received: by B4 Relay for noralf@tronnes.org/20221122 with auth_id=8 X-Original-From: =?utf-8?q?Noralf_Tr=C3=B8nnes?= Reply-To: noralf@tronnes.org From: Noralf Trønnes The MIPI DBI 2.0 specification (2005) lists only two pixel formats for the Type C Interface (SPI) and that is 3-bits/pixel RGB111 with 2 options for bit layout. For Type A and B (parallel) the following formats are listed: RGB332, RGB444, RGB565, RGB666 and RGB888 (some have 2 options for the bit layout). Many MIPI DBI compatible controllers support all interface types on the same chip and often the manufacturers have chosen to provide support for the Type A/B interface pixel formats also on the Type C interface. Some chips provide many pixel formats with optional bit layouts over SPI, but the most common by far are RGB565 and RGB666. So even if the specification doesn't list these formats for the Type C interface, the industry has chosen to include them. The MIPI DCS specification lists the standard commands that can be sent over the MIPI DBI interface. The set_address_mode (36h) command has one bit in the parameter that controls RGB/BGR order: This bit controls the RGB data latching order transferred from the peripheral’s frame memory to the display device. This means that each supported RGB format also has a BGR variant. Based on this rationale document the following pixel formats describing the bit layout going over the wire: - RGB111 (option 1): x2r1g1b1r1g1b1 (2 pixels per byte) - BGR111 (option 1): x2b1g1r1b1g1r1 (2 pixels per byte) - RGB111 (option 2): x1r1g1b1x1r1g1b1 (2 pixels per byte) - BGR111 (option 2): x1b1g1r1x1b1g1r1 (2 pixels per byte) - RGB565: r5g6b5 (2 bytes) - BGR565: b5g6r5 (2 bytes) - RGB666: r6x2g6x2b6x2 (3 bytes) - BGR666: b6x2g6x2r6x2 (3 bytes) (x: don't care) v2: - Use 'default: r5g6b5' (Rob) Reviewed-by: Rob Herring (Arm) Signed-off-by: Noralf Trønnes --- .../bindings/display/panel/panel-mipi-dbi-spi.yaml | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml b/Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml index e808215cb39e..8994549b4bff 100644 --- a/Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml +++ b/Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml @@ -50,6 +50,12 @@ description: | | Command or data | || + The standard defines one pixel format for type C: RGB111. The industry + however has decided to provide the type A/B interface pixel formats also on + the Type C interface and most common among these are RGB565 and RGB666. + The MIPI DCS command set_address_mode (36h) has one bit that controls RGB/BGR + order. This gives each supported RGB format a BGR variant. + The panel resolution is specified using the panel-timing node properties hactive (width) and vactive (height). The other mandatory panel-timing properties should be set to zero except clock-frequency which can be @@ -90,6 +96,28 @@ properties: spi-3wire: true + format: + description: > + Pixel format in bit order as going on the wire: + * `x2r1g1b1r1g1b1` - RGB111, 2 pixels per byte + * `x2b1g1r1b1g1r1` - BGR111, 2 pixels per byte + * `x1r1g1b1x1r1g1b1` - RGB111, 2 pixels per byte + * `x1b1g1r1x1b1g1r1` - BGR111, 2 pixels per byte + * `r5g6b5` - RGB565, 2 bytes + * `b5g6r5` - BGR565, 2 bytes + * `r6x2g6x2b6x2` - RGB666, 3 bytes + * `b6x2g6x2r6x2` - BGR666, 3 bytes + enum: + - x2r1g1b1r1g1b1 + - x2b1g1r1b1g1r1 + - x1r1g1b1x1r1g1b1 + - x1b1g1r1x1b1g1r1 + - r5g6b5 + - b5g6r5 + - r6x2g6x2b6x2 + - b6x2g6x2r6x2 + default: r5g6b5 + required: - compatible - reg @@ -116,6 +144,8 @@ examples: reset-gpios = <&gpio 25 GPIO_ACTIVE_HIGH>; write-only; + format = "r5g6b5"; + backlight = <&backlight>; width-mm = <35>; -- 2.45.1