lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 20 Nov 2015 16:15:30 +0800
From:	Chris Zhong <zyw@...k-chips.com>
To:	heiko@...ech.de, linux-rockchip@...ts.infradead.org,
	mark.yao@...k-chips.com, treding@...dia.com,
	emil.l.velikov@...il.com
Cc:	airlied@...ux.ie, ajaykumar.rs@...sung.com,
	rmk+kernel@....linux.org.uk, dri-devel@...ts.freedesktop.org,
	Liu Ying <Ying.liu@...escale.com>,
	Liu Ying <Ying.Liu@...escale.com>,
	Chris Zhong <zyw@...k-chips.com>, linux-kernel@...r.kernel.org
Subject: [PATCH v4 04/13] drm/dsi: Add a helper to get bits per pixel of MIPI DSI pixel format

From: Liu Ying <Ying.liu@...escale.com>

Signed-off-by: Liu Ying <Ying.Liu@...escale.com>
Acked-by: Thierry Reding <treding@...dia.com>
Signed-off-by: Chris Zhong <zyw@...k-chips.com>
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 include/drm/drm_mipi_dsi.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h
index f1d8d0d..3662021 100644
--- a/include/drm/drm_mipi_dsi.h
+++ b/include/drm/drm_mipi_dsi.h
@@ -163,6 +163,20 @@ static inline struct mipi_dsi_device *to_mipi_dsi_device(struct device *dev)
 	return container_of(dev, struct mipi_dsi_device, dev);
 }
 
+static inline int mipi_dsi_pixel_format_to_bpp(enum mipi_dsi_pixel_format fmt)
+{
+	switch (fmt) {
+	case MIPI_DSI_FMT_RGB888:
+	case MIPI_DSI_FMT_RGB666:
+		return 24;
+	case MIPI_DSI_FMT_RGB666_PACKED:
+		return 18;
+	case MIPI_DSI_FMT_RGB565:
+		return 16;
+	}
+	return -EINVAL;
+}
+
 struct mipi_dsi_device *of_find_mipi_dsi_device_by_node(struct device_node *np);
 int mipi_dsi_attach(struct mipi_dsi_device *dsi);
 int mipi_dsi_detach(struct mipi_dsi_device *dsi);
-- 
2.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ