From: Chris Zhong <zyw@rock-chips.com> To: heiko@sntech.de, linux-rockchip@lists.infradead.org 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 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@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 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
WARNING: multiple messages have this Message-ID (diff)
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
next prev parent reply other threads:[~2015-10-31 12:59 UTC|newest] Thread overview: 35+ 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 ` Chris Zhong 2015-10-31 12:55 ` Chris Zhong 2015-10-31 12:55 ` [PATCH v2 01/13] clk: rockchip: add id for mipidsi sclk on rk3288 Chris Zhong 2015-10-31 12:55 ` [PATCH v2 02/13] clk: rockchip: add mipidsi clocks " Chris Zhong 2015-10-31 12:55 ` Chris Zhong 2015-10-31 12:55 ` [PATCH v2 03/13] drm/rockchip: return a true clock rate to adjusted_mode Chris Zhong 2015-10-31 12:55 ` Chris Zhong 2015-10-31 12:56 ` Chris Zhong [this message] 2015-10-31 12:56 ` [PATCH v2 04/13] drm/dsi: Add a helper to get bits per pixel of MIPI DSI pixel format Chris Zhong 2015-10-31 12:56 ` [PATCH v2 05/13] Documentation: dt-bindings: Add bindings for Synopsys DW MIPI DSI DRM bridge driver Chris Zhong 2015-11-06 2:21 ` Rob Herring 2015-11-06 2:21 ` Rob Herring 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 ` Chris Zhong 2015-10-31 12:56 ` [PATCH v2 08/13] Documentation: dt-bindings: Add bindings for rk3288 DW MIPI DSI driver Chris Zhong 2015-10-31 12:56 ` Chris Zhong 2015-11-06 2:18 ` Rob Herring 2015-11-06 2:18 ` Rob Herring 2015-10-31 12:56 ` [PATCH v2 09/13] ARM: dts: rockchip: add rk3288 mipi_dsi nodes Chris Zhong 2015-10-31 12:56 ` Chris Zhong 2015-10-31 12:56 ` Chris Zhong 2015-10-31 12:56 ` [PATCH v2 10/13] of: add vendor prefix for boe Chris Zhong 2015-11-03 2:24 ` Rob Herring 2015-11-03 2:24 ` Rob Herring 2015-10-31 12:56 ` [PATCH v2 11/13] drm/panel: simple: Add support for BOE TV080WUM-NL0 Chris Zhong 2015-10-31 12:56 ` [PATCH v2 12/13] drm/panel: simple: Add simple panel device tree binding Chris Zhong 2015-10-31 12:56 ` Chris Zhong 2015-11-02 15:06 ` Rob Herring 2015-11-02 15:06 ` Rob Herring 2015-11-03 0:28 ` Chris Zhong 2015-11-03 0:28 ` Chris Zhong 2015-10-31 12:56 ` [PATCH v2 13/13] ARM: dts: rockchip: add support mipi panel tv080wum-nl0 for rk3288-evb Chris Zhong 2015-10-31 12:56 ` 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@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 \ /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: linkBe 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.