dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Zhong <zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
To: heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Cc: Chris Zhong <zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org>,
	David Airlie <airlied-cv59FeDIM0c@public.gmane.org>,
	Liu Ying <Ying.Liu-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH v2 04/13] drm/dsi: Add a helper to get bits per pixel of MIPI DSI pixel format
Date: Sat, 31 Oct 2015 20:56:00 +0800	[thread overview]
Message-ID: <1446296170-3702-5-git-send-email-zyw@rock-chips.com> (raw)
In-Reply-To: <1446296170-3702-1-git-send-email-zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org>

From: Liu Ying <Ying.liu-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

Signed-off-by: Liu Ying <Ying.Liu-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Acked-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Chris Zhong <zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
---

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.2

  parent reply	other threads:[~2015-10-31 12:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-31 12:55 [PATCH v2 00/13] Add mipi dsi support for rk3288 Chris Zhong
2015-10-31 12:55 ` [PATCH v2 03/13] drm/rockchip: return a true clock rate to adjusted_mode Chris Zhong
     [not found] ` <1446296170-3702-1-git-send-email-zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2015-10-31 12:56   ` Chris Zhong [this message]
2015-10-31 12:56   ` [PATCH v2 12/13] drm/panel: simple: Add simple panel device tree binding Chris Zhong
     [not found]     ` <1446296170-3702-13-git-send-email-zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2015-11-02 15:06       ` Rob Herring
     [not found]         ` <CAL_Jsq+76CMdtu8MZZhb_Bbg+J=hjJ2as-NRnjS4w_3y0YXvLA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-11-03  0:28           ` Chris Zhong
2015-10-31 12:56 ` [PATCH v2 06/13] drm/bridge: Add Synopsys DesignWare MIPI DSI host controller driver Chris Zhong
2015-10-31 12:56 ` [PATCH v2 07/13] drm: rockchip: Support Synopsys DesignWare MIPI DSI host controller Chris Zhong
2015-10-31 12:56 ` [PATCH v2 11/13] drm/panel: simple: Add support for BOE TV080WUM-NL0 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=1446296170-3702-5-git-send-email-zyw@rock-chips.com \
    --to=zyw-tnx95d0mmh7dzftrwevzcw@public.gmane.org \
    --cc=Ying.Liu-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=airlied-cv59FeDIM0c@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox