drm/sun4i: sun6i_mipi_dsi: fix DCS long write packet length
authorIcenowy Zheng <icenowy@aosc.io>
Sun, 6 Oct 2019 16:03:02 +0000 (00:03 +0800)
committerMaxime Ripard <mripard@kernel.org>
Mon, 7 Oct 2019 12:01:25 +0000 (14:01 +0200)
The packet length of DCS long write packet should not be added with 1
when constructing long write packet.

Fix this.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20191006160303.24413-4-icenowy@aosc.io
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c

index 5acdddfbcb25599501f5ed6f6b2b4bf5ad47bc12..000c4a5de05929ca2b1703235e9d26b42a86eb93 100644 (file)
@@ -832,8 +832,8 @@ static u32 sun6i_dsi_dcs_build_pkt_hdr(struct sun6i_dsi *dsi,
        u32 pkt = msg->type;
 
        if (msg->type == MIPI_DSI_DCS_LONG_WRITE) {
-               pkt |= ((msg->tx_len + 1) & 0xffff) << 8;
-               pkt |= (((msg->tx_len + 1) >> 8) & 0xffff) << 16;
+               pkt |= ((msg->tx_len) & 0xffff) << 8;
+               pkt |= (((msg->tx_len) >> 8) & 0xffff) << 16;
        } else {
                pkt |= (((u8 *)msg->tx_buf)[0] << 8);
                if (msg->tx_len > 1)