All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Zhong <zyw@rock-chips.com>
To: heiko@sntech.de, linux-rockchip@lists.infradead.org,
	mark.yao@rock-chips.com, treding@nvidia.com
Cc: Liu Ying <Ying.liu@freescale.com>,
	Liu Ying <Ying.Liu@freescale.com>,
	Chris Zhong <zyw@rock-chips.com>, David Airlie <airlied@linux.ie>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH v6 2/6] drm/dsi: Add a helper to get bits per pixel of MIPI DSI pixel format
Date: Wed, 16 Dec 2015 18:10:12 +0800	[thread overview]
Message-ID: <1450260616-21160-3-git-send-email-zyw@rock-chips.com> (raw)
In-Reply-To: <1450260616-21160-1-git-send-email-zyw@rock-chips.com>

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


WARNING: multiple messages have this Message-ID (diff)
From: Chris Zhong <zyw@rock-chips.com>
To: heiko@sntech.de, linux-rockchip@lists.infradead.org,
	mark.yao@rock-chips.com, treding@nvidia.com
Cc: Chris Zhong <zyw@rock-chips.com>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: [PATCH v6 2/6] drm/dsi: Add a helper to get bits per pixel of MIPI DSI pixel format
Date: Wed, 16 Dec 2015 18:10:12 +0800	[thread overview]
Message-ID: <1450260616-21160-3-git-send-email-zyw@rock-chips.com> (raw)
In-Reply-To: <1450260616-21160-1-git-send-email-zyw@rock-chips.com>

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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2015-12-16 10:11 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-16 10:10 [PATCH v6 0/6] Add mipi dsi support for rk3288 Chris Zhong
2015-12-16 10:10 ` Chris Zhong
2015-12-16 10:10 ` Chris Zhong
2015-12-16 10:10 ` [PATCH v6 1/6] drm/rockchip: return a true clock rate to adjusted_mode Chris Zhong
2015-12-16 10:10   ` Chris Zhong
2015-12-16 10:10   ` Chris Zhong
2015-12-16 10:10 ` Chris Zhong [this message]
2015-12-16 10:10   ` [PATCH v6 2/6] drm/dsi: Add a helper to get bits per pixel of MIPI DSI pixel format Chris Zhong
2015-12-16 10:10 ` [PATCH v6 3/6] Documentation: dt-bindings: Add bindings for rk3288 DW MIPI DSI driver Chris Zhong
2015-12-16 10:10   ` Chris Zhong
2015-12-16 10:10 ` [PATCH v6 4/6] drm: rockchip: Support Synopsys DW MIPI DSI Chris Zhong
2015-12-16 10:10   ` Chris Zhong
2015-12-16 10:10   ` Chris Zhong
2015-12-18  9:47   ` [PATCH v6.1 " Chris Zhong
2015-12-18  9:47     ` Chris Zhong
2015-12-18  9:47     ` Chris Zhong
2015-12-18 10:18     ` Mark yao
2015-12-18 10:18       ` Mark yao
2015-12-18 10:18       ` Mark yao
2015-12-22  6:58   ` [PATCH v6.2 " Chris Zhong
2015-12-22  6:58     ` Chris Zhong
2015-12-22  6:58     ` Chris Zhong
2015-12-23  3:43   ` [PATCH v6.3 " Chris Zhong
2015-12-23  3:43     ` Chris Zhong
2015-12-23  3:43     ` Chris Zhong
2015-12-24  0:55     ` Mark yao
2015-12-24  0:55       ` Mark yao
2015-12-24  0:55       ` Mark yao
2016-01-06  1:48     ` Mark yao
2016-01-06  1:48       ` Mark yao
2016-01-06  1:48       ` Mark yao
2016-01-06  4:16       ` Chris Zhong
2016-01-06  4:16         ` Chris Zhong
2016-01-06  4:16         ` Chris Zhong
2016-01-06  2:04     ` Mark yao
2016-01-06  2:04       ` Mark yao
2016-01-06  2:04       ` Mark yao
2015-12-16 10:10 ` [PATCH v6 5/6] ARM: dts: rockchip: add rk3288 mipi_dsi nodes Chris Zhong
2015-12-16 10:10   ` Chris Zhong
2015-12-16 10:10   ` Chris Zhong
2015-12-16 10:10 ` [PATCH v6 6/6] ARM: dts: rockchip: add support mipi panel tv080wum-nl0 Chris Zhong
2015-12-16 10:10   ` Chris Zhong
2015-12-17  9:29 ` [PATCH v6 0/6] Add mipi dsi support for rk3288 Heiko Stübner
2015-12-17  9:29   ` Heiko Stübner
2015-12-17  9:29   ` Heiko Stübner
2015-12-18  9:54   ` Chris Zhong
2015-12-18  9:54     ` Chris Zhong
2015-12-18  9:54     ` Chris Zhong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1450260616-21160-3-git-send-email-zyw@rock-chips.com \
    --to=zyw@rock-chips.com \
    --cc=Ying.liu@freescale.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mark.yao@rock-chips.com \
    --cc=treding@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.