Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1292863

[PATCH v6 2/6] drm/dsi: Add a helper to get bits per pixel of MIPI DSI pixel format

From Chris Zhong <zyw@rock-chips.com>
Newsgroups linux.kernel
Subject [PATCH v6 2/6] drm/dsi: Add a helper to get bits per pixel of MIPI DSI pixel format
Date 2015-12-16 11:20 +0100
Message-ID <qGhlE-s9-19@gated-at.bofh.it> (permalink)
References <qGhlD-s9-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
---

Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: 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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v6 0/6] Add mipi dsi support for rk3288 Chris Zhong <zyw@rock-chips.com> - 2015-12-16 11:20 +0100
  [PATCH v6 2/6] drm/dsi: Add a helper to get bits per pixel of MIPI DSI pixel format Chris Zhong <zyw@rock-chips.com> - 2015-12-16 11:20 +0100
  [PATCH v6 6/6] ARM: dts: rockchip: add support mipi panel tv080wum-nl0 Chris Zhong <zyw@rock-chips.com> - 2015-12-16 11:20 +0100
  [PATCH v6 3/6] Documentation: dt-bindings: Add bindings for rk3288 DW MIPI DSI driver Chris Zhong <zyw@rock-chips.com> - 2015-12-16 11:20 +0100
  [PATCH v6 4/6] drm: rockchip: Support Synopsys DW MIPI DSI Chris Zhong <zyw@rock-chips.com> - 2015-12-16 11:20 +0100
    [PATCH v6.1 4/6] drm: rockchip: Support Synopsys DW MIPI DSI Chris Zhong <zyw@rock-chips.com> - 2015-12-18 10:50 +0100
      Re: [PATCH v6.1 4/6] drm: rockchip: Support Synopsys DW MIPI DSI Mark yao <mark.yao@rock-chips.com> - 2015-12-18 11:20 +0100
    [PATCH v6.2 4/6] drm: rockchip: Support Synopsys DW MIPI DSI Chris Zhong <zyw@rock-chips.com> - 2015-12-22 08:00 +0100
    [PATCH v6.3 4/6] drm: rockchip: Support Synopsys DW MIPI DSI Chris Zhong <zyw@rock-chips.com> - 2015-12-23 04:50 +0100
      Re: [PATCH v6.3 4/6] drm: rockchip: Support Synopsys DW MIPI DSI Mark yao <mark.yao@rock-chips.com> - 2015-12-24 02:00 +0100
  Re: [PATCH v6 0/6] Add mipi dsi support for rk3288 Heiko Stübner <heiko@sntech.de> - 2015-12-17 11:10 +0100
    Re: [PATCH v6 0/6] Add mipi dsi support for rk3288 Chris Zhong <zyw@rock-chips.com> - 2015-12-18 11:00 +0100

csiph-web