All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Gao <eric.gao@rock-chips.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 07/11] rockchip: video: vop: Set different bitwidth for different display mode
Date: Thu, 20 Apr 2017 12:45:55 +0800	[thread overview]
Message-ID: <1492663559-8248-8-git-send-email-eric.gao@rock-chips.com> (raw)
In-Reply-To: <1492663559-8248-1-git-send-email-eric.gao@rock-chips.com>

Because the bitwidth is different for different display mode, so we need
to set them according to demand.

Signed-off-by: Eric Gao <eric.gao@rock-chips.com>

---

Changes in v4: None
Changes in v3: None
Changes in v2:
-Change the bitwidth for different display mode.

 drivers/video/rockchip/rk_vop.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/video/rockchip/rk_vop.c b/drivers/video/rockchip/rk_vop.c
index e6c4ea8..5f5db9e 100644
--- a/drivers/video/rockchip/rk_vop.c
+++ b/drivers/video/rockchip/rk_vop.c
@@ -181,13 +181,11 @@ void rkvop_mode_set(struct rk3288_vop *regs,
  *
  * @dev:	VOP device that we want to connect to the display
  * @fbbase:	Frame buffer address
- * @l2bpp	Log2 of bits-per-pixels for the display
  * @ep_node:	Device tree node to process - this is the offset of an endpoint
  *		node within the VOP's 'port' list.
  * @return 0 if OK, -ve if something went wrong
  */
-int rk_display_init(struct udevice *dev, ulong fbbase,
-		    enum video_log2_bpp l2bpp, int ep_node)
+int rk_display_init(struct udevice *dev, ulong fbbase, int ep_node)
 {
 	struct video_priv *uc_priv = dev_get_uclass_priv(dev);
 	const void *blob = gd->fdt_blob;
@@ -199,6 +197,7 @@ int rk_display_init(struct udevice *dev, ulong fbbase,
 	int ret, remote, i, offset;
 	struct display_plat *disp_uc_plat;
 	struct clk clk;
+	enum video_log2_bpp l2bpp;
 
 	vop_id = fdtdec_get_int(blob, ep_node, "reg", -1);
 	debug("vop_id=%d\n", vop_id);
@@ -255,6 +254,19 @@ int rk_display_init(struct udevice *dev, ulong fbbase,
 		}
 	}
 
+	/* Set bitwidth for vop display according to vop mode */
+	switch (vop_id) {
+	case VOP_MODE_EDP:
+	case VOP_MODE_HDMI:
+	case VOP_MODE_LVDS:
+		l2bpp = VIDEO_BPP16;
+		break;
+	case VOP_MODE_MIPI:
+		l2bpp = VIDEO_BPP32;
+		break;
+	default:
+		l2bpp = VIDEO_BPP16;
+	}
 	rkvop_mode_set(regs, &timing, vop_id);
 
 	rkvop_enable(regs, fbbase, 1 << l2bpp, &timing);
@@ -332,7 +344,7 @@ static int rk_vop_probe(struct udevice *dev)
 	for (node = fdt_first_subnode(blob, port);
 	     node > 0;
 	     node = fdt_next_subnode(blob, node)) {
-		ret = rk_display_init(dev, plat->base, VIDEO_BPP16, node);
+		ret = rk_display_init(dev, plat->base, node);
 		if (ret)
 			debug("Device failed: ret=%d\n", ret);
 		if (!ret)
-- 
1.9.1

  parent reply	other threads:[~2017-04-20  4:45 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-20  4:45 [U-Boot] [PATCH v4 00/11] Add mipi dsi display support for rockchip soc Eric Gao
2017-04-20  4:45 ` [U-Boot] [PATCH v4 01/11] rockchip: include: grf: Add GRF register declaration for mipi dsi Eric Gao
2017-04-20 12:28   ` Simon Glass
2017-04-21 11:06   ` Dr. Philipp Tomsich
2017-04-21 11:43   ` Dr. Philipp Tomsich
2017-04-20  4:45 ` [U-Boot] [PATCH v4 02/11] rockchip: video: Add mipi driver for rockchip soc Eric Gao
2017-04-20 12:28   ` Simon Glass
2017-04-20  4:45 ` [U-Boot] [PATCH v4 03/11] rockchip: video: Makefile: Add mipi driver addition Eric Gao
2017-04-20  4:45 ` [U-Boot] [PATCH v4 04/11] rockchip: video: Kconfig: " Eric Gao
2017-04-20  4:45 ` [U-Boot] [PATCH v4 05/11] rockchip: video: vop: Fix rk_display_init() return error Eric Gao
2017-04-20 12:29   ` Simon Glass
2017-04-20  4:45 ` [U-Boot] [PATCH v4 06/11] rockchip: video: vop: Add mipi display mode for rk3399 Eric Gao
2017-04-20 12:29   ` Simon Glass
2017-04-20  4:45 ` Eric Gao [this message]
2017-04-20 12:29   ` [U-Boot] [PATCH v4 07/11] rockchip: video: vop: Set different bitwidth for different display mode Simon Glass
2017-04-20  4:45 ` [U-Boot] [PATCH v4 08/11] rockchip: video: vop: Reserve enough space for mipi dispaly Eric Gao
2017-04-20 12:29   ` Simon Glass
2017-04-20  4:45 ` [U-Boot] [PATCH v4 09/11] rockchip: board: evb_rk3399: initialize pwm0 for dispaly backlight Eric Gao
2017-04-20 12:29   ` Simon Glass
2017-04-20  4:45 ` [U-Boot] [PATCH v4 10/11] rockchip: dts: Add mipi dsi support for rk3399 Eric Gao
2017-04-20 12:29   ` Simon Glass
2017-04-20  4:45 ` [U-Boot] [PATCH v4 11/11] rockchip: configs: Enable mipi dsi " Eric Gao
2017-04-20 12:29   ` Simon Glass
2017-04-21  3:05 ` [U-Boot] [PATCH v4 00/11] Add mipi dsi display support for rockchip soc Simon Glass
2017-04-28 14:55 ` [U-Boot] [PATCH] rockchip: video: introduce CONFIG_DESIGNWARE_HDMI and select for Rockchip HDMI Philipp Tomsich
2017-04-30  3:48   ` Simon Glass
2017-05-15 18:19   ` [U-Boot] [PATCH] rockchip: video: introduce VIDEO_DW_HDMI " Anatolij Gustschin

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=1492663559-8248-8-git-send-email-eric.gao@rock-chips.com \
    --to=eric.gao@rock-chips.com \
    --cc=u-boot@lists.denx.de \
    /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.