From patchwork Fri Oct 31 22:54:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 5207261 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8367E9F318 for ; Fri, 31 Oct 2014 23:56:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8132120158 for ; Fri, 31 Oct 2014 23:56:46 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 8B9C820120 for ; Fri, 31 Oct 2014 23:56:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 830E06E849; Fri, 31 Oct 2014 16:56:33 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by gabe.freedesktop.org (Postfix) with ESMTP id 684396E854 for ; Fri, 31 Oct 2014 15:57:36 -0700 (PDT) Received: by mail-pa0-f54.google.com with SMTP id rd3so8651275pab.27 for ; Fri, 31 Oct 2014 15:57:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Nc1UCTWYcslYLTfLMI+qn1Ze3j233dWiKcGWDpk/Q6A=; b=fSLaNruUCvapA2LlFScVDJMVX/o7rhIqPyEkKJ6cDuzMYa+cgVxiRuU7cHCw74IyNd 9VRpnC0Cqzqs0JFZlFSEFEZ9VlaGjTs2mfD9zaoyRMa4qRfGMMKUC7MRkU2YH+flavkx 9bvwY/xVFVYw/hh+Sm36r6YlGHLZ8iir/1QbU0zZ/1NUlfuGtyjpwZy6XTEPKiLrQSfY qYFSpv+DSk4fcAy8AU8tEKHuqL5byp20EOJnext/857yASPRGQYfl6Aqvwbct5cP7SXr 2tk1dXUkh+Jg/FDmpOeY5iRZXEfd+bVjf5qWIL2ksi5qV7rCPu4CPn5+e6b1WoBgzWti 339g== X-Received: by 10.66.240.228 with SMTP id wd4mr26084145pac.113.1414796256307; Fri, 31 Oct 2014 15:57:36 -0700 (PDT) Received: from mothership.mgc.mentorg.com (c-50-152-159-227.hsd1.ca.comcast.net. [50.152.159.227]) by mx.google.com with ESMTPSA id ev8sm10870656pdb.28.2014.10.31.15.57.35 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Oct 2014 15:57:35 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: dri-devel@lists.freedesktop.org Subject: [PATCH 58/72] imx-drm: parallel-display: Add interface-pix-map DT property Date: Fri, 31 Oct 2014 15:54:41 -0700 Message-Id: <1414796095-10107-59-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1414796095-10107-1-git-send-email-steve_longerbeam@mentor.com> References: <1414796095-10107-1-git-send-email-steve_longerbeam@mentor.com> X-Mailman-Approved-At: Fri, 31 Oct 2014 16:56:32 -0700 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Define a new devicetree property "interface-pix-map" for use by i.MX DRM display drivers. This property defines a DI interface pixel bus mapping. Implement the parsing of this property in the parallel display driver, and pass on the mapping to imx_drm_panel_format(). See Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt for a complete description of this property. Signed-off-by: Steve Longerbeam --- .../bindings/staging/imx-drm/fsl-imx-drm.txt | 43 ++++++++++++++++++-- drivers/staging/imx-drm/parallel-display.c | 25 +++++++++++- 2 files changed, 63 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt b/Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt index e75f0e5..a9146f8 100644 --- a/Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt +++ b/Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt @@ -59,9 +59,26 @@ Parallel display support Required properties: - compatible: Should be "fsl,imx-parallel-display" Optional properties: -- interface_pix_fmt: How this display is connected to the - display interface. Currently supported types: "rgb24", "rgb565", "bgr666" - and "lvds666". +- interface-pix-map: Defines a pixel mapping onto the 24-bit IPU + Display Interface bus to the display. Internally the IPU represents + pixels in either RGB24 or YUV444 format. This property tells the IPU how + to map those RGB24 or YUV444 pixels onto the display interface bus. + The data format is as follows: + + interface-pix-map = ; + + where: + c0, c1, c2: are the color components (c0 = B/V, c1 = G/U, c2 = R/Y) + src-mask: is the mask of component source bits to be forwarded + to the DI bus + dest-msb: defines where to place those component bits on the + 24-bit DI bus, represented as the MSBit on the bus. + +- interface-pix-fmt: A name given to the pixel format sent to the display. + The following are names with pre-defined pixel mappings that do not + require an explicit interface-pix-map property: "rgb24", "rgb565", "rgb666" + - edid: verbatim EDID data block describing attached display. - ddc: phandle describing the i2c bus handling the display data channel @@ -81,3 +98,23 @@ display@di0 { }; }; }; + +Pixel map examples: + +This example defines a new format named "bgr565" using a pixel map: + +display@di0 { + compatible = "fsl,imx-parallel-display"; + edid = [edid-data]; + interface-pix-fmt = "bgr565"; + interface-pix-map = <15 0xf8 10 0xfc 4 0xf8>; +}; + +This example defines an unnamed format where an rgb666 format is shifted +up by 6 bits on the DI bus: + +display@di0 { + compatible = "fsl,imx-parallel-display"; + edid = [edid-data]; + interface-pix-map = <11 0xfc 17 0xfc 23 0xfc>; +}; diff --git a/drivers/staging/imx-drm/parallel-display.c b/drivers/staging/imx-drm/parallel-display.c index 667a9b3..e0b0b56 100644 --- a/drivers/staging/imx-drm/parallel-display.c +++ b/drivers/staging/imx-drm/parallel-display.c @@ -26,6 +26,7 @@ #include #include #include