From patchwork Fri Aug 9 17:14:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 2842517 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 39963BF546 for ; Sat, 10 Aug 2013 18:24:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4F16B2027F for ; Sat, 10 Aug 2013 18:24:45 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 1FBEA2029B for ; Sat, 10 Aug 2013 18:24:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D910BE6941 for ; Sat, 10 Aug 2013 11:24:43 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [95.142.166.194]) by gabe.freedesktop.org (Postfix) with ESMTP id 83375E6104 for ; Fri, 9 Aug 2013 10:14:26 -0700 (PDT) Received: from avalon.ideasonboard.com (unknown [109.134.65.8]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9556136709; Fri, 9 Aug 2013 19:14:06 +0200 (CEST) From: Laurent Pinchart To: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH/RFC v3 07/19] video: display: Add pixel coding definitions Date: Fri, 9 Aug 2013 19:14:58 +0200 Message-Id: <1376068510-30363-8-git-send-email-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1376068510-30363-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> References: <1376068510-30363-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> X-Mailman-Approved-At: Sat, 10 Aug 2013 11:06:24 -0700 Cc: Sebastien Guiriec , Jesse Barnes , Benjamin Gaignard , Tom Gall , Kyungmin Park , Tomi Valkeinen , Stephen Warren , Mark Zhang , =?UTF-8?q?St=C3=A9phane=20Marchesin?= , Alexandre Courbot , Ragesh Radhakrishnan , Thomas Petazzoni , Sunil Joshi , Maxime Ripard , Vikas Sajjan , Marcus Lorentzon X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,KHOP_BIG_TO_CC, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham 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 Pixel codings describe how pixels are transmitted on a physical bus. The information can be communicated between drivers to configure devices. Signed-off-by: Laurent Pinchart --- include/video/display.h | 120 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) diff --git a/include/video/display.h b/include/video/display.h index 36ff637..ba319d6 100644 --- a/include/video/display.h +++ b/include/video/display.h @@ -18,6 +18,126 @@ #include #include +#define DISPLAY_PIXEL_CODING(option, type, from, to, variant) \ + (((option) << 17) | ((type) << 13) | ((variant) << 10) | \ + ((to) << 5) | (from)) + +#define DISPLAY_PIXEL_CODING_FROM(coding) ((coding) & 0x1f) +#define DISPLAY_PIXEL_CODING_TO(coding) (((coding) >> 5) & 0x1f) +#define DISPLAY_PIXEL_CODING_VARIANT(coding) (((coding) >> 10) & 7) +#define DISPLAY_PIXEL_CODING_TYPE(coding) (((coding) >> 13) & 0xf) + +#define DISPLAY_PIXEL_CODING_TYPE_DBI 0 +#define DISPLAY_PIXEL_CODING_TYPE_DPI 1 + +/* DBI pixel codings. */ +#define DISPLAY_PIXEL_CODING_DBI(from, to, variant) \ + DISPLAY_PIXEL_CODING_TYPE(DISPLAY_PIXEL_CODING_TYPE_DBI, \ + from, to, variant, 0) + +/* Standard DBI codings, defined in the DBI specification. */ +/* 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 */ +/* - - - - - - - - - - R0,2 R0,1 R0,0 G0,2 G0,1 G0,0 B0,1 B0,0 */ +#define DISPLAY_PIXEL_CODING_DBI_8TO8 DISPLAY_PIXEL_CODING_DBI(8, 8, 0) +/* - - - - - - - - - - R0,3 R0,2 R0,1 R0,0 G0,3 G0,2 G0,1 G0,0 */ +/* - - - - - - - - - - B0,3 B0,2 B0,1 B0,0 R1,3 R1,2 R1,1 R1,0 */ +/* - - - - - - - - - - G1,3 G1,2 G1,1 G1,0 B1,3 B1,2 B1,1 b1,0 */ +#define DISPLAY_PIXEL_CODING_DBI_12TO8 DISPLAY_PIXEL_CODING_DBI(12, 8, 0) +/* - - - - - - - - - - R0,4 R0,3 R0,2 R0,1 R0,0 G0,5 G0,4 G0,3 */ +/* - - - - - - - - - - G0,2 G0,1 G0,0 B0,4 B0,3 B0,2 B0,1 B0,0 */ +#define DISPLAY_PIXEL_CODING_DBI_16TO8 DISPLAY_PIXEL_CODING_DBI(16, 8, 0) +/* - - - - - - - - - - R0,5 R0,4 R0,3 R0,2 R0,1 R0,0 - - */ +/* - - - - - - - - - - G0,5 G0,4 G0,3 G0,2 G0,1 G0,0 - - */ +/* - - - - - - - - - - B0,5 B0,4 B0,3 B0,2 B0,1 B0,0 - - */ +#define DISPLAY_PIXEL_CODING_DBI_18TO8 DISPLAY_PIXEL_CODING_DBI(18, 8, 0) +/* - - - - - - - - - - R0,7 R0,6 R0,5 R0,4 R0,3 R0,2 R0,1 R0,0 */ +/* - - - - - - - - - - G0,7 G0,6 G0,5 G0,4 G0,3 G0,2 G0,1 G0,0 */ +/* - - - - - - - - - - B0,7 B0,6 B0,5 B0,4 B0,3 B0,2 B0,1 B0,0 */ +#define DISPLAY_PIXEL_CODING_DBI_24TO8 DISPLAY_PIXEL_CODING_DBI(24, 8, 0) +/* - - - - - - - - - R0,5 R0,4 R0,3 R0,2 R0,1 R0,0 G0,5 G0,4 G0,4 */ +/* - - - - - - - - - G0,2 G0,1 G0,0 B0,5 B0,4 B0,3 B0,2 B0,1 B0,0 */ +#define DISPLAY_PIXEL_CODING_DBI_18TO9 DISPLAY_PIXEL_CODING_DBI(18, 9, 0) +/* - - R1,2 R1,1 R1,0 G1,2 G1,1 G1,0 B1,1 B1,0 R0,2 R0,1 R0,0 G0,2 G0,1 G0,0 B0,1 B0,0 */ +#define DISPLAY_PIXEL_CODING_DBI_8TO16 DISPLAY_PIXEL_CODING_DBI(8, 16, 0) +/* - - - - - - R0,3 R0,2 R0,1 R0,0 G0,3 G0,2 G0,1 G0,0 B0,3 B0,2 B0,1 B0,0 */ +#define DISPLAY_PIXEL_CODING_DBI_12TO16 DISPLAY_PIXEL_CODING_DBI(12, 16, 0) +/* - - R0,4 R0,3 R0,2 R0,1 R0,0 G0,5 G0,4 G0,3 G0,2 G0,1 G0,0 B0,4 B0,3 B0,2 B0,1 B0,0 */ +#define DISPLAY_PIXEL_CODING_DBI_16TO16 DISPLAY_PIXEL_CODING_DBI(16, 16, 0) +/* - - R0,5 R0,4 R0,3 R0,2 R0,1 R0,0 - - G0,5 G0,4 G0,3 G0,2 G0,1 G0,0 - - */ +/* - - B0,5 B0,4 B0,3 B0,2 B0,1 B0,0 - - R1,5 R1,4 R1,3 R1,2 R1,1 R1,0 - - */ +/* - - G1,5 G1,4 G1,3 G1,2 G1,1 G1,0 - - B1,5 B1,4 B1,3 B1,2 B1,1 B1,0 - - */ +#define DISPLAY_PIXEL_CODING_DBI_18TO16_A DISPLAY_PIXEL_CODING_DBI(18, 16, 0) +/* - - - - - - - - - - R0,5 R0,4 R0,3 R0,2 R0,1 R0,0 - - */ +/* - - G0,5 G0,4 G0,3 G0,2 G0,1 G0,0 - - B0,5 B0,4 B0,3 B0,2 B0,1 B0,0 - - */ +#define DISPLAY_PIXEL_CODING_DBI_18TO16_B DISPLAY_PIXEL_CODING_DBI(18, 16, 1) +/* - - R0,7 R0,6 R0,5 R0,4 R0,3 R0,2 R0,1 R0,0 G0,7 G0,6 G0,5 G0,4 G0,3 G0,2 G0,1 G0,0 */ +/* - - B0,7 B0,6 B0,5 B0,4 B0,3 B0,2 B0,1 B0,0 R1,7 R1,6 R1,5 R1,4 R1,3 R1,2 R1,1 R1,0 */ +/* - - G1,7 G1,6 G1,5 G1,4 G1,3 G1,2 G1,1 G1,0 B1,7 B1,6 B1,5 B1,4 B1,3 B1,2 B1,1 B1,0 */ +#define DISPLAY_PIXEL_CODING_DBI_24TO16_A DISPLAY_PIXEL_CODING_DBI(24, 16, 0) +/* - - - - - - - - - - R0,7 R0,6 R0,5 R0,4 R0,3 R0,2 R0,1 R0,0 */ +/* - - G0,7 G0,6 G0,5 G0,4 G0,3 G0,2 G0,1 G0,0 B0,7 B0,6 B0,5 B0,4 B0,3 B0,2 B0,1 B0,0 */ +#define DISPLAY_PIXEL_CODING_DBI_24TO16_B DISPLAY_PIXEL_CODING_DBI(24, 16, 1) + +/* Non-standard DBI pixel codings. */ +/* 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 */ +/* - - - - - - - - - - R0,5 R0,4 R0,3 R0,2 R0,1 R0,0 G0,5 G0,4 */ +/* - - - - - - - - - - G0,3 G0,2 G0,1 G0,0 B0,5 B0,4 B0,3 B0,2 */ +/* - - - - - - - - - - - - - - - - B0,1 B0,0 */ +#define DISPLAY_PIXEL_CODING_DBI_18TO8_B DISPLAY_PIXEL_CODING_DBI(18, 8, 1) +/* - - - - - - - - - - - - - - - - R0,5 R0,4 */ +/* - - - - - - - - - - R0,3 R0,2 R0,1 R0,0 G0,5 G0,4 G0,3 G0,2 */ +/* - - - - - - - - - - G0,1 G0,0 B0,5 B0,4 B0,3 B0,2 B0,1 B0,0 */ +#define DISPLAY_PIXEL_CODING_DBI_18TO8_C DISPLAY_PIXEL_CODING_DBI(18, 8, 2) +/* - - R0,5 R0,4 R0,3 R0,2 R0,1 R0,0 G0,5 G0,4 G0,3 G0,2 G0,1 G0,0 B0,5 B0,4 B0,3 B0,2 */ +/* - - B0,1 B0,0 - - - - - - - - - - - - - - */ +#define DISPLAY_PIXEL_CODING_DBI_18TO16_C DISPLAY_PIXEL_CODING_DBI(18, 16, 2) +/* - - R0,5 R0,4 - - - - - - - - - - - - - - */ +/* - - R0,3 R0,2 R0,1 R0,0 G0,5 G0,4 G0,3 G0,2 G0,1 G0,0 B0,5 B0,4 B0,3 B0,2 B0,1 B0,0 */ +#define DISPLAY_PIXEL_CODING_DBI_18TO16_D DISPLAY_PIXEL_CODING_DBI(18, 16, 3) +/* - - - - - - R0,7 R0,6 R0,5 R0,4 R0,3 R0,2 R0,1 R0,0 G0,7 G0,6 G0,5 G0,4 */ +/* - - - - - - G0,3 G0,2 G0,1 G0,0 B0,7 B0,6 B0,5 B0,4 B0,3 B0,2 B0,1 B0,0 */ +#define DISPLAY_PIXEL_CODING_DBI_24TO12 DISPLAY_PIXEL_CODING_DBI(24, 12, 0) +/* R0,5 R0,4 R0,3 R0,2 R0,1 R0,0 G0,5 G0,4 G0,3 G0,2 G0,1 G0,0 B0,5 B0,4 B0,3 B0,2 B0,1 B0,0 */ +#define DISPLAY_PIXEL_CODING_DBI_18TO18 DISPLAY_PIXEL_CODING_DBI(18, 18, 0) + +/* DPI pixel codings. */ +#define DISPLAY_PIXEL_CODING_DPI_RGB(from, to, variant) \ + DISPLAY_PIXEL_CODING_TYPE(DISPLAY_PIXEL_CODING_TYPE_DPI, \ + from, to, variant, 0) +#define DISPLAY_PIXEL_CODING_DPI_YUV(from, to, variant) \ + DISPLAY_PIXEL_CODING_TYPE(DISPLAY_PIXEL_CODING_TYPE_DPI, \ + from, to, variant, 1) + +/* Standard DPI codings, defined in the DPI specification. */ +/* 23 22 21 20 19 28 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 */ +/* - - - - - - - - R4 R3 R2 R1 R0 G5 G4 G3 G2 G1 G0 B4 B3 B2 B1 B0 */ +#define DISPLAY_PIXEL_CODING_DPI_RGB_16TO16 DISPLAY_PIXEL_CODING_DPI_RGB(16, 16, 0) +/* - - - - - - R5 R4 R3 R2 R1 R0 G5 G4 G3 G2 G1 G0 B5 B4 B3 B2 B1 B0 */ +#define DISPLAY_PIXEL_CODING_DPI_RGB_18TO18 DISPLAY_PIXEL_CODING_DPI_RGB(18, 18, 0) +/* - - - R4 R3 R2 R1 R0 - - G5 G4 G3 G2 G1 G0 - - - B4 B3 B2 B1 B0 */ +#define DISPLAY_PIXEL_CODING_DPI_RGB_16TO20 DISPLAY_PIXEL_CODING_DPI_RGB(16, 20, 0) +/* - - R4 R3 R2 R1 R0 - - - G5 G4 G3 G2 G1 G0 - - B4 B3 B2 B1 B0 - */ +#define DISPLAY_PIXEL_CODING_DPI_RGB_16TO22 DISPLAY_PIXEL_CODING_DPI_RGB(16, 22, 0) +/* - - R5 R4 R3 R2 R1 R0 - - G5 G4 G3 G2 G1 G0 - - B5 B4 B3 B2 B1 B0 */ +#define DISPLAY_PIXEL_CODING_DPI_RGB_18TO22 DISPLAY_PIXEL_CODING_DPI_RGB(18, 22, 0) +/* R7 R6 R5 R4 R3 R2 R1 R0 G7 G6 G5 G4 G3 G2 G1 G0 B7 B6 B5 B4 B3 B2 B1 B0 */ +#define DISPLAY_PIXEL_CODING_DPI_RGB_24TO24 DISPLAY_PIXEL_CODING_DPI_RGB(24, 24, 0) + +/* Non-standard DPI pixel codings. */ +/* 23 22 21 20 19 28 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 */ +/* - - - - - - - - - - - - - - - - R7 R6 R5 R4 R3 R2 R1 R0 */ +/* - - - - - - - - - - - - - - - - G7 G6 G5 G4 G3 G2 G1 G0 */ +/* - - - - - - - - - - - - - - - - B7 B6 B5 B4 B3 B2 B1 B0 */ +#define DISPLAY_PIXEL_CODING_DPI_RGB_24TO8 DISPLAY_PIXEL_CODING_DPI_RGB(24, 8, 0) +/* - - - - - - - - - - - - - - - R5 R4 R3 R2 R1 R0 G5 G4 G3 */ +/* - - - - - - - - - - - - - - - G2 G1 G0 B5 B4 B3 B2 B1 B0 */ +#define DISPLAY_PIXEL_CODING_DPI_RGB_18TO9 DISPLAY_PIXEL_CODING_DPI_RGB(18, 9, 0) +/* - - - - - - - - - - - - R3 R2 R1 R0 G3 G2 G1 G0 B3 B2 B1 B0 */ +#define DISPLAY_PIXEL_CODING_DPI_RGB_12TO12 DISPLAY_PIXEL_CODING_DPI_RGB(12, 12, 0) +/* - - - - - - - - - - - - R7 R6 R5 R4 R3 R2 R1 R0 G7 G6 G5 G4 */ +/* - - - - - - - - - - - - G3 G2 G1 G0 B7 B6 B5 B4 B3 B2 B1 B0 */ +#define DISPLAY_PIXEL_CODING_DPI_RGB_24TO12 DISPLAY_PIXEL_CODING_DPI_RGB(24, 12, 0) + /* ----------------------------------------------------------------------------- * Display Entity */