From patchwork Wed Mar 27 09:19:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 2349131 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 19E843FD40 for ; Wed, 27 Mar 2013 10:07:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F3C0EE65AB for ; Wed, 27 Mar 2013 03:07:08 -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 A81F9E5DF4 for ; Wed, 27 Mar 2013 02:18:45 -0700 (PDT) Received: from avalon.ideasonboard.com (unknown [109.134.86.112]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C489A35A4D for ; Wed, 27 Mar 2013 10:18:29 +0100 (CET) From: Laurent Pinchart To: dri-devel@lists.freedesktop.org Subject: [RFC/PATCH] drm: Add XRGB8626262 (RGB 6:6:6) pixel format Date: Wed, 27 Mar 2013 10:19:29 +0100 Message-Id: <1364375969-5266-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 1.8.1.5 X-Mailman-Approved-At: Wed, 27 Mar 2013 03:06:36 -0700 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 This format is an odd beast, implemented by Renesas R-Car hardware. It stores RGB 6:6:6 pixels in 32 bits as [31:0] x:R:x:G:x:B:x 8:6:2:6:2:6:2 little endian Signed-off-by: Laurent Pinchart --- Hello, I came across this weird format on a Renesas SoC display controller. This is essentially XRGB8888 with the two low order bits of each component ignored by the hardware. The proposed name is intentionally over-descriptive to trigger comments (hopefully resulting in a proposal for a better name :-)). To be honest I'm not too sure what kind of use case such a format could have. diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index f2d667b..7e1a19d 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -2210,6 +2210,7 @@ static int format_check(const struct drm_mode_fb_cmd2 *r) case DRM_FORMAT_BGR565: case DRM_FORMAT_RGB888: case DRM_FORMAT_BGR888: + case DRM_FORMAT_XRGB8626262: case DRM_FORMAT_XRGB8888: case DRM_FORMAT_XBGR8888: case DRM_FORMAT_RGBX8888: diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h index 646ae5f..1f01161 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/include/uapi/drm/drm_fourcc.h @@ -67,6 +67,8 @@ #define DRM_FORMAT_BGR888 fourcc_code('B', 'G', '2', '4') /* [23:0] B:G:R little endian */ /* 32 bpp RGB */ +#define DRM_FORMAT_XRGB8626262 fourcc_code('X', 'R', '1', '8') /* [31:0] x:R:x:G:x:B:x 8:6:2:6:2:6:2 little endian */ + #define DRM_FORMAT_XRGB8888 fourcc_code('X', 'R', '2', '4') /* [31:0] x:R:G:B 8:8:8:8 little endian */ #define DRM_FORMAT_XBGR8888 fourcc_code('X', 'B', '2', '4') /* [31:0] x:B:G:R 8:8:8:8 little endian */ #define DRM_FORMAT_RGBX8888 fourcc_code('R', 'X', '2', '4') /* [31:0] R:G:B:x 8:8:8:8 little endian */