From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrzej Hajda Subject: Re: [PATCH 13/15] drm/dsi: Always use low-power mode for DCS commands Date: Thu, 16 Oct 2014 09:00:27 +0200 Message-ID: <543F6D0B.6090800@samsung.com> References: <1413195395-3355-1-git-send-email-thierry.reding@gmail.com> <1413195395-3355-13-git-send-email-thierry.reding@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mailout4.w1.samsung.com (mailout4.w1.samsung.com [210.118.77.14]) by gabe.freedesktop.org (Postfix) with ESMTP id 2FAB66E1E1 for ; Thu, 16 Oct 2014 00:00:36 -0700 (PDT) Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NDI00GEVZLJIN20@mailout4.w1.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 16 Oct 2014 08:03:19 +0100 (BST) In-reply-to: <1413195395-3355-13-git-send-email-thierry.reding@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Thierry Reding , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On 10/13/2014 12:16 PM, Thierry Reding wrote: > From: Thierry Reding > > Many peripherals require DCS commands to be sent in low power mode and > will fail to correctly process them in high speed mode. Section 5.2 of > the MIPI DSI specification also mandates that on bidirectional lanes, > data shall be transmitted in low power mode only. I guess you are referring to phrase: "For bidirectional Lanes, data shall be transmitted in the peripheral-to-processor, or reverse, direction using Low-Power (LP) Mode only". This phrase is not clear but I guess the part "peripheral-to-processor, or reverse, direction" should be read as "peripheral-to-processor (ie. reverse) direction". Otherwise we would end up with insane restriction. > At worst this change > will make transmission of DCS commands slower than optimal on some DSI > peripherals, but it should enable DCS commands to be successfully > transmitted to any DSI peripheral. I can imagine necessity of sending DCS/MCS commands in blank periods of video mode. In such case speed matters and in corner cases it will not be even possible to transmit message in LP mode. > > If transmission in low power mode turns out to be too slow at some point > in the future, one possible solution would be to explicitly mark devices > that support high speed transmission of DCS commands. We have MIPI_DSI_MODE_LPM flag in dsi.mode_flags it should be enough, DCS helper should just check it. Regards Andrzej > > Signed-off-by: Thierry Reding > --- > drivers/gpu/drm/drm_mipi_dsi.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c > index d4d3cf752be7..a0b9c7ea77a7 100644 > --- a/drivers/gpu/drm/drm_mipi_dsi.c > +++ b/drivers/gpu/drm/drm_mipi_dsi.c > @@ -370,6 +370,7 @@ ssize_t mipi_dsi_dcs_write_buffer(struct mipi_dsi_device *dsi, > { > struct mipi_dsi_msg msg = { > .channel = dsi->channel, > + .flags = MIPI_DSI_MSG_USE_LPM, > .tx_buf = data, > .tx_len = len > }; > @@ -457,6 +458,7 @@ ssize_t mipi_dsi_dcs_write(struct mipi_dsi_device *dsi, u8 cmd, > } > > memset(&msg, 0, sizeof(msg)); > + msg.flags = MIPI_DSI_MSG_USE_LPM; > msg.channel = dsi->channel; > msg.tx_len = size; > msg.tx_buf = tx; > @@ -500,6 +502,7 @@ ssize_t mipi_dsi_dcs_read(struct mipi_dsi_device *dsi, u8 cmd, void *data, > struct mipi_dsi_msg msg = { > .channel = dsi->channel, > .type = MIPI_DSI_DCS_READ, > + .flags = MIPI_DSI_MSG_USE_LPM, > .tx_buf = &cmd, > .tx_len = 1, > .rx_buf = data,