From: Jani Nikula <jani.nikula@intel.com>
To: Madhav Chauhan <madhav.chauhan@intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v8 16/38] drm/i915/icl: Program HS_TX_TIMEOUT/LP_RX_TIMEOUT/TA_TIMEOUT registers
Date: Wed, 31 Oct 2018 13:18:42 +0200 [thread overview]
Message-ID: <87sh0ml5yl.fsf@intel.com> (raw)
In-Reply-To: <db846ed6-4e1b-d6d6-683c-9908e286c1cd@intel.com>
On Wed, 31 Oct 2018, Madhav Chauhan <madhav.chauhan@intel.com> wrote:
> On 10/30/2018 5:26 PM, Jani Nikula wrote:
>> From: Madhav Chauhan <madhav.chauhan@intel.com>
>>
>> Program the timeout values (in escape clock) for HS TX, LP RX and TA
>> timeout.
>>
>> HX TX: Ensure that host does not continuously transmit in the HS
>> state. If this timer expires, then host will gracefully end its HS
>> transmission and allow the link to enter into LP state.
>>
>> LP RX: Monitor the length of LP receptions from Peripheral. If timeout
>> happens then host will drive the stop state onto all data lanes (only
>> Data Lane 0 should be receiving anything from the Peripheral). This
>> effectively takes back ownership of the bus transmit in the HS state.
>>
>> TA timeout: Timeout valuefor monitoring Bus Turn-Around (BTA) sequence.
>> BTA sequence should complete within a bounded amount of time, with
>> peripheral acknowledging BTA by driving the stop state.
>>
>> v2 by Jani:
>> - Rebase
>> - Use intel_dsi_bitrate() and intel_dsi_tlpx_ns(intel_dsi)
>> - Squash HX TX, LP RX and TA timeout into one patch
>> - Fix bspec mode set sequence reference
>> - Add FIXME about two timeouts
>
> Looks fine.
Thanks, pushed up to and including this patch.
BR,
Jani.
>
> Regards,
> Madhav
>
>> Signed-off-by: Madhav Chauhan <madhav.chauhan@intel.com>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>> drivers/gpu/drm/i915/icl_dsi.c | 52 ++++++++++++++++++++++++++++++++++++
>> drivers/gpu/drm/i915/intel_dsi.h | 1 +
>> drivers/gpu/drm/i915/intel_dsi_vbt.c | 1 +
>> 3 files changed, 54 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/icl_dsi.c b/drivers/gpu/drm/i915/icl_dsi.c
>> index ac22c74ae146..fd82f349ced9 100644
>> --- a/drivers/gpu/drm/i915/icl_dsi.c
>> +++ b/drivers/gpu/drm/i915/icl_dsi.c
>> @@ -685,6 +685,55 @@ static void gen11_dsi_enable_transcoder(struct intel_encoder *encoder)
>> }
>> }
>>
>> +static void gen11_dsi_setup_timeouts(struct intel_encoder *encoder)
>> +{
>> + struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
>> + struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
>> + enum port port;
>> + enum transcoder dsi_trans;
>> + u32 tmp, hs_tx_timeout, lp_rx_timeout, ta_timeout, divisor, mul;
>> +
>> + /*
>> + * escape clock count calculation:
>> + * BYTE_CLK_COUNT = TIME_NS/(8 * UI)
>> + * UI (nsec) = (10^6)/Bitrate
>> + * TIME_NS = (BYTE_CLK_COUNT * 8 * 10^6)/ Bitrate
>> + * ESCAPE_CLK_COUNT = TIME_NS/ESC_CLK_NS
>> + */
>> + divisor = intel_dsi_tlpx_ns(intel_dsi) * intel_dsi_bitrate(intel_dsi) * 1000;
>> + mul = 8 * 1000000;
>> + hs_tx_timeout = DIV_ROUND_UP(intel_dsi->hs_tx_timeout * mul,
>> + divisor);
>> + lp_rx_timeout = DIV_ROUND_UP(intel_dsi->lp_rx_timeout * mul, divisor);
>> + ta_timeout = DIV_ROUND_UP(intel_dsi->turn_arnd_val * mul, divisor);
>> +
>> + for_each_dsi_port(port, intel_dsi->ports) {
>> + dsi_trans = dsi_port_to_transcoder(port);
>> +
>> + /* program hst_tx_timeout */
>> + tmp = I915_READ(DSI_HSTX_TO(dsi_trans));
>> + tmp &= ~HSTX_TIMEOUT_VALUE_MASK;
>> + tmp |= HSTX_TIMEOUT_VALUE(hs_tx_timeout);
>> + I915_WRITE(DSI_HSTX_TO(dsi_trans), tmp);
>> +
>> + /* FIXME: DSI_CALIB_TO */
>> +
>> + /* program lp_rx_host timeout */
>> + tmp = I915_READ(DSI_LPRX_HOST_TO(dsi_trans));
>> + tmp &= ~LPRX_TIMEOUT_VALUE_MASK;
>> + tmp |= LPRX_TIMEOUT_VALUE(lp_rx_timeout);
>> + I915_WRITE(DSI_LPRX_HOST_TO(dsi_trans), tmp);
>> +
>> + /* FIXME: DSI_PWAIT_TO */
>> +
>> + /* program turn around timeout */
>> + tmp = I915_READ(DSI_TA_TO(dsi_trans));
>> + tmp &= ~TA_TIMEOUT_VALUE_MASK;
>> + tmp |= TA_TIMEOUT_VALUE(ta_timeout);
>> + I915_WRITE(DSI_TA_TO(dsi_trans), tmp);
>> + }
>> +}
>> +
>> static void
>> gen11_dsi_enable_port_and_phy(struct intel_encoder *encoder,
>> const struct intel_crtc_state *pipe_config)
>> @@ -704,6 +753,9 @@ gen11_dsi_enable_port_and_phy(struct intel_encoder *encoder,
>> /* setup D-PHY timings */
>> gen11_dsi_setup_dphy_timings(encoder);
>>
>> + /* step 4h: setup DSI protocol timeouts */
>> + gen11_dsi_setup_timeouts(encoder);
>> +
>> /* Step (4h, 4i, 4j, 4k): Configure transcoder */
>> gen11_dsi_configure_transcoder(encoder, pipe_config);
>> }
>> diff --git a/drivers/gpu/drm/i915/intel_dsi.h b/drivers/gpu/drm/i915/intel_dsi.h
>> index 10fd1582a8e2..f2a3ddedcc5d 100644
>> --- a/drivers/gpu/drm/i915/intel_dsi.h
>> +++ b/drivers/gpu/drm/i915/intel_dsi.h
>> @@ -95,6 +95,7 @@ struct intel_dsi {
>> u16 lp_byte_clk;
>>
>> /* timeouts in byte clocks */
>> + u16 hs_tx_timeout;
>> u16 lp_rx_timeout;
>> u16 turn_arnd_val;
>> u16 rst_timer_val;
>> diff --git a/drivers/gpu/drm/i915/intel_dsi_vbt.c b/drivers/gpu/drm/i915/intel_dsi_vbt.c
>> index cca071406c25..80bd56e96143 100644
>> --- a/drivers/gpu/drm/i915/intel_dsi_vbt.c
>> +++ b/drivers/gpu/drm/i915/intel_dsi_vbt.c
>> @@ -799,6 +799,7 @@ bool intel_dsi_vbt_init(struct intel_dsi *intel_dsi, u16 panel_id)
>> intel_dsi->video_mode_format = mipi_config->video_transfer_mode;
>> intel_dsi->escape_clk_div = mipi_config->byte_clk_sel;
>> intel_dsi->lp_rx_timeout = mipi_config->lp_rx_timeout;
>> + intel_dsi->hs_tx_timeout = mipi_config->hs_tx_timeout;
>> intel_dsi->turn_arnd_val = mipi_config->turn_around_timeout;
>> intel_dsi->rst_timer_val = mipi_config->device_reset_timer;
>> intel_dsi->init_count = mipi_config->master_init_timer;
>
--
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-10-31 11:17 UTC|newest]
Thread overview: 75+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-30 11:56 [PATCH v8 00/38] drm/i915/icl: dsi enabling Jani Nikula
2018-10-30 11:56 ` [PATCH v8 01/38] drm/i915/icl: Move dsi host init code to common file Jani Nikula
2018-10-30 11:56 ` [PATCH v8 02/38] drm/i915/dsi: move connector mode functions " Jani Nikula
2018-10-31 9:20 ` Madhav Chauhan
2018-10-30 11:56 ` [PATCH v8 03/38] drm/i915/icl: Set max return packet size for DSI panel Jani Nikula
2018-10-31 9:24 ` Madhav Chauhan
2018-10-31 9:40 ` Jani Nikula
2018-10-30 11:56 ` [PATCH v8 04/38] drm/i915/icl: Power on " Jani Nikula
2018-10-31 9:42 ` Jani Nikula
2018-10-30 11:56 ` [PATCH v8 05/38] drm/i915/icl: Wait for header/payload credits release Jani Nikula
2018-10-31 10:06 ` Madhav Chauhan
2018-10-30 11:56 ` [PATCH v8 06/38] drm/i915/icl: Turn ON panel backlight Jani Nikula
2018-10-30 11:56 ` [PATCH v8 07/38] drm/i915/icl: Turn OFF " Jani Nikula
2018-10-30 11:56 ` [PATCH v8 08/38] drm/i915/icl: Disable DSI transcoders Jani Nikula
2018-10-31 10:10 ` Madhav Chauhan
2018-10-30 11:56 ` [PATCH v8 09/38] drm/i915/icl: Power down DSI panel Jani Nikula
2018-10-30 11:56 ` [PATCH v8 10/38] drm/i915/icl: Put DSI link in ULPS Jani Nikula
2018-10-30 11:56 ` [PATCH v8 11/38] drm/i915/icl: Disable DDI function Jani Nikula
2018-10-30 11:56 ` [PATCH v8 12/38] drm/i915/icl: Disable portsync mode Jani Nikula
2018-10-30 11:56 ` [PATCH v8 13/38] drm/i915/icl: Disable DSI ports Jani Nikula
2018-10-30 11:56 ` [PATCH v8 14/38] drm/i915/icl: Disable DSI IO power Jani Nikula
2018-10-30 11:56 ` [PATCH v8 15/38] drm/i915/icl: Define DSI timeout registers Jani Nikula
2018-10-31 10:29 ` Madhav Chauhan
2018-10-30 11:56 ` [PATCH v8 16/38] drm/i915/icl: Program HS_TX_TIMEOUT/LP_RX_TIMEOUT/TA_TIMEOUT registers Jani Nikula
2018-10-31 11:01 ` Madhav Chauhan
2018-10-31 11:18 ` Jani Nikula [this message]
2018-10-30 11:56 ` [PATCH v8 17/38] drm/i915/icl: Find DSI presence for ICL Jani Nikula
2018-10-31 11:19 ` Madhav Chauhan
2018-11-01 15:39 ` Jani Nikula
2018-11-01 11:09 ` Jani Nikula
2018-10-30 11:56 ` [PATCH v8 18/38] drm/i915/icl: Allocate DSI encoder/connector Jani Nikula
2018-10-31 11:24 ` Madhav Chauhan
2018-10-30 11:56 ` [PATCH v8 19/38] drm/i915/icl: Allocate hosts for DSI ports Jani Nikula
2018-10-31 11:26 ` Madhav Chauhan
2018-10-30 11:56 ` [PATCH v8 20/38] drm/i915/icl: Add DSI packet payload/header registers Jani Nikula
2018-10-31 11:43 ` Madhav Chauhan
2018-11-01 11:10 ` Jani Nikula
2018-10-30 11:56 ` [PATCH v8 21/38] drm/i915/icl: Fetch DSI pkt to be transferred Jani Nikula
2018-10-31 11:45 ` Madhav Chauhan
2018-10-30 11:56 ` [PATCH v8 22/38] drm/i915/icl: Load DSI packet payload to queue Jani Nikula
2018-10-31 11:51 ` Madhav Chauhan
2018-10-30 11:56 ` [PATCH v8 23/38] drm/i915/icl: Add get config functionality for DSI Jani Nikula
2018-10-30 11:56 ` [PATCH v8 24/38] drm/i915/icl: Get HW state for DSI encoder Jani Nikula
2018-10-31 11:57 ` Madhav Chauhan
2018-11-01 14:24 ` Imre Deak
2018-10-30 11:56 ` [PATCH v8 25/38] drm/i915/icl: Add DSI connector functions Jani Nikula
2018-11-01 14:03 ` Madhav Chauhan
2018-10-30 11:56 ` [PATCH v8 26/38] drm/i915/icl: Add DSI connector helper functions Jani Nikula
2018-11-01 14:03 ` Madhav Chauhan
2018-10-30 11:56 ` [PATCH v8 27/38] drm/i915/icl: Add DSI encoder remaining functions Jani Nikula
2018-11-01 14:08 ` Madhav Chauhan
2018-10-30 11:56 ` [PATCH v8 28/38] drm/i915/icl: Fill DSI ports info Jani Nikula
2018-10-30 11:56 ` [PATCH v8 29/38] drm/i915/icl: Add DSS_CTL Registers Jani Nikula
2018-11-01 15:27 ` Jani Nikula
2018-11-01 18:12 ` Manasi Navare
2018-10-30 11:56 ` [PATCH v8 30/38] drm/i915/icl: Configure DSI Dual link mode Jani Nikula
2018-11-01 14:11 ` Madhav Chauhan
2018-10-30 11:56 ` [PATCH v8 31/38] drm/i915/icl: Define Panel power ctrl register Jani Nikula
2018-10-30 11:56 ` [PATCH v8 32/38] drm/i915/icl: Define missing bitfield for shortplug reg Jani Nikula
2018-10-30 11:56 ` [PATCH v8 33/38] drm/i915/icl: Define display GPIO pins for DSI Jani Nikula
2018-10-30 11:56 ` [PATCH v8 34/38] drm/i915/icl: Add changes to program DSI panel GPIOs Jani Nikula
2018-10-30 14:01 ` Ville Syrjälä
2018-10-30 14:08 ` Jani Nikula
2018-11-01 14:56 ` Madhav Chauhan
2018-10-30 11:56 ` [PATCH v8 35/38] HACK: drm/i915/icl: Configure backlight functions for DSI Jani Nikula
2018-10-30 11:56 ` [PATCH v8 36/38] drm/i915/icl: Don't wait for empty FIFO Jani Nikula
2018-11-01 11:10 ` Jani Nikula
2018-10-30 11:56 ` [PATCH v8 37/38] drm/i915/icl: Consider DSI for getting transcoder state Jani Nikula
2018-10-30 14:04 ` Ville Syrjälä
2018-10-30 11:56 ` [PATCH v8 38/38] drm/i915/icl: Get pipe timings for DSI Jani Nikula
2018-10-30 12:17 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/icl: dsi enabling (rev3) Patchwork
2018-10-30 12:26 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-10-30 12:51 ` ✗ Fi.CI.BAT: failure " Patchwork
2018-10-30 13:07 ` [PATCH v8 00/38] drm/i915/icl: dsi enabling Jani Nikula
2018-10-30 16:07 ` ✗ Fi.CI.BAT: failure for drm/i915/icl: dsi enabling (rev3) Patchwork
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=87sh0ml5yl.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=madhav.chauhan@intel.com \
/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.