drm/i915/display: Enable DP Display Audio WA
Subsystems (3)
PATCH v6 1/1 drm/i915/display: Enable DP Display Audio WA
For certain DP VDSC bpp settings, hblank asserts before hblank_early, leading to a bad audio state. Driver need to program "hblank early enable" and "samples per line" parameters in AUDIO_CONFIG_BE register.
This is Display Audio WA #1406928334 for 4k+VDSC usecase applicable on DP encoders. Implemented the same.
v2: Fixed build failures on 32bit machine.
v3: Dropped u64, added helpers for sample room calculation,
other general comments as per Jani Nikula's feedback. Also fixed connector type check (spotted by Anshuman)
v4: Addressed Jani Nikula and Kai's review comments.
v5: Addressed Anshuman's review comment and used crtc_* variable
to get timings.
v6: Dropped a redundant initialization.
--- drivers/gpu/drm/i915/display/intel_audio.c | 146 +++++++++++++++++++++ drivers/gpu/drm/i915/i915_reg.h | 16 +++ 2 files changed, 162 insertions(+)
drivers/gpu/drm/i915/display/intel_audio.c +146 -0
@@ -514,6 +514,148 @@ static void hsw_audio_codec_disable(struct intel_encoder *encoder,mutex_unlock (&dev_priv->av_mutex); } +/* Add a factor to take care of rounding and truncations */ +#define ROUNDING_FACTOR 10000 + +static unsigned int get_hblank_early_enable_config (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state) +{ +struct drm_i915_private *i915 =to_i915 (encoder->base.dev); +unsigned int link_clks_available, link_clks_required; +unsigned int tu_data, tu_line, link_clks_active; +unsigned int hblank_rise, hblank_early_prog; +unsigned int h_active, h_total, hblank_delta, pixel_clk, v_total; +unsigned int fec_coeff, refresh_rate, cdclk, vdsc_bpp; + + h_active = crtc_state->hw.adjusted_mode.crtc_hdisplay; + h_total = crtc_state->hw.adjusted_mode.crtc_htotal; + v_total = crtc_state->hw.adjusted_mode.crtc_vtotal; + pixel_clk = crtc_state->hw.adjusted_mode.crtc_clock; + refresh_rate = crtc_state->hw.adjusted_mode.vrefresh; + vdsc_bpp = crtc_state->dsc.compressed_bpp; + cdclk = i915->cdclk.hw.cdclk; +/* fec= 0.972261, using rounding multiplier of 1000000 */ + fec_coeff =972261 ; + +drm_dbg_kms (&i915->drm,"h_active = %u link_clk = %u :" +"lanes = %u vdsc_bpp = %u cdclk = %u\n" , + h_active, crtc_state->port_clock, crtc_state->lane_count, + vdsc_bpp, cdclk); + + link_clks_available = ((((h_total - h_active) * + ((crtc_state->port_clock *ROUNDING_FACTOR ) / + pixel_clk)) /ROUNDING_FACTOR ) -28 ); + + link_clks_required =DIV_ROUND_UP (192000 , (refresh_rate * + v_total)) * ((48 / + crtc_state->lane_count) +2 ); + +if (link_clks_available > link_clks_required) + hblank_delta =32 ; +else + hblank_delta =DIV_ROUND_UP (((((5 *ROUNDING_FACTOR ) / + crtc_state->port_clock) + ((5 * +ROUNDING_FACTOR ) / + cdclk)) * pixel_clk), +ROUNDING_FACTOR ); + + tu_data = (pixel_clk * vdsc_bpp *8 ) / ((crtc_state->port_clock * + crtc_state->lane_count * fec_coeff) /1000000 ); + tu_line = (((h_active * crtc_state->port_clock * fec_coeff) / +1000000 ) / (64 * pixel_clk)); + link_clks_active = (tu_line -1 ) *64 + tu_data; + + hblank_rise = ((link_clks_active +6 *DIV_ROUND_UP (link_clks_active, +250 ) +4 ) * ((pixel_clk *ROUNDING_FACTOR ) / + crtc_state->port_clock)) /ROUNDING_FACTOR ; + + hblank_early_prog = h_active - hblank_rise + hblank_delta; + +return hblank_early_prog; +} + +static unsigned int get_sample_room_req_config (const struct intel_crtc_state *crtc_state) +{ +unsigned int h_active, h_total, pixel_clk; +unsigned int samples_room; + + h_active = crtc_state->hw.adjusted_mode.hdisplay; + h_total = crtc_state->hw.adjusted_mode.htotal; + pixel_clk = crtc_state->hw.adjusted_mode.clock; + + samples_room = ((((h_total - h_active) * ((crtc_state->port_clock * +ROUNDING_FACTOR ) / pixel_clk)) / +ROUNDING_FACTOR ) -12 ) / ((48 / + crtc_state->lane_count) +2 ); + +return samples_room; +} + +static void enable_audio_dsc_wa (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state) +{ +struct drm_i915_private *i915 =to_i915 (encoder->base.dev); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); +enum pipe pipe = crtc->pipe; +unsigned int hblank_early_prog, samples_room, h_active; +unsigned int val; + +if (INTEL_GEN (i915) <11 ) +return ; + + h_active = crtc_state->hw.adjusted_mode.hdisplay; + +if (!(h_active && crtc_state->port_clock && crtc_state->lane_count && + crtc_state->dsc.compressed_bpp && i915->cdclk.hw.cdclk)) { +drm_err (&i915->drm,"Null Params rcvd for hblank early enabling\n" ); +WARN_ON (1 ); +return ; + } + + val =intel_de_read (i915,AUD_CONFIG_BE ); + +if (INTEL_GEN (i915) ==11 ) + val |=HBLANK_EARLY_ENABLE_ICL (pipe); +else if (INTEL_GEN (i915) >=12 ) + val |=HBLANK_EARLY_ENABLE_TGL (pipe); + +if (crtc_state->dsc.compression_enable && + (crtc_state->hw.adjusted_mode.hdisplay >=3840 && + crtc_state->hw.adjusted_mode.vdisplay >=2160 )) { +/* Get hblank early enable value required */ + hblank_early_prog =get_hblank_early_enable_config (encoder, + crtc_state); +if (hblank_early_prog <32 ) { + val &= ~HBLANK_START_COUNT_MASK (pipe); + val |=HBLANK_START_COUNT (pipe,HBLANK_START_COUNT_32 ); + }else if (hblank_early_prog <64 ) { + val &= ~HBLANK_START_COUNT_MASK (pipe); + val |=HBLANK_START_COUNT (pipe,HBLANK_START_COUNT_64 ); + }else if (hblank_early_prog <96 ) { + val &= ~HBLANK_START_COUNT_MASK (pipe); + val |=HBLANK_START_COUNT (pipe,HBLANK_START_COUNT_96 ); + }else { + val &= ~HBLANK_START_COUNT_MASK (pipe); + val |=HBLANK_START_COUNT (pipe,HBLANK_START_COUNT_128 ); + } + +/* Get samples room value required */ + samples_room =get_sample_room_req_config (crtc_state); +if (samples_room <3 ) { + val &= ~NUMBER_SAMPLES_PER_LINE_MASK (pipe); + val |=NUMBER_SAMPLES_PER_LINE (pipe, samples_room); + }else { +/* Program 0 i.e "All Samples available in buffer" */ + val &= ~NUMBER_SAMPLES_PER_LINE_MASK (pipe); + val |=NUMBER_SAMPLES_PER_LINE (pipe,0x0 ); + } + } + +intel_de_write (i915,AUD_CONFIG_BE , val); +} + +#undef ROUNDING_FACTOR +static void hsw_audio_codec_enable (struct intel_encoder *encoder,const struct intel_crtc_state *crtc_state,const struct drm_connector_state *conn_state)
@@ -531,6 +673,10 @@ static void hsw_audio_codec_enable(struct intel_encoder *encoder,mutex_lock (&dev_priv->av_mutex); +/* Enable Audio WA for 4k DSC usecases */ +if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_DP )) +enable_audio_dsc_wa (encoder, crtc_state); +/* Enable audio presence detect, invalidate ELD */ tmp =intel_de_read (dev_priv,HSW_AUD_PIN_ELD_CP_VLD ); tmp |=AUDIO_OUTPUT_ENABLE (cpu_transcoder);
drivers/gpu/drm/i915/i915_reg.h +16 -0
@@ -9396,6 +9396,22 @@ enum {#define AUD_PIN_BUF_CTL _MMIO(0x48414)#define AUD_PIN_BUF_ENABLE REG_BIT(31) +/* Display Audio Config Reg */ +#define AUD_CONFIG_BE _MMIO(0x65ef0) +#define HBLANK_EARLY_ENABLE_ICL (pipe) (0x1 << (20 - (pipe))) +#define HBLANK_EARLY_ENABLE_TGL (pipe) (0x1 << (24 + (pipe))) +#define HBLANK_START_COUNT_MASK (pipe) (0x7 << (3 + ((pipe) * 6))) +#define HBLANK_START_COUNT (pipe, val) (((val) & 0x7) << (3 + ((pipe)) * 6)) +#define NUMBER_SAMPLES_PER_LINE_MASK (pipe) (0x3 << ((pipe) * 6)) +#define NUMBER_SAMPLES_PER_LINE (pipe, val) (((val) & 0x3) << ((pipe) * 6)) + +#define HBLANK_START_COUNT_8 0 +#define HBLANK_START_COUNT_16 1 +#define HBLANK_START_COUNT_32 2 +#define HBLANK_START_COUNT_64 3 +#define HBLANK_START_COUNT_96 4 +#define HBLANK_START_COUNT_128 5 +/* * HSW - ICL power wells *
Signature · 6 lines
2.22.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.DOCS: warning for drm/i915/display: Enable DP Display Audio WA (rev6)
== Series Details ==
== Series Details ==
Series: drm/i915/display: Enable DP Display Audio WA (rev6)
URL : https://patchwork.freedesktop.org/series/75582/
State : warning
== Summary ==
$ make htmldocs 2>&1 > /dev/null | grep i915 /home/cidrm/kernel/Documentation/gpu/i915.rst:610: WARNING: duplicate label gpu/i915:layout, other instance in /home/cidrm/kernel/Documentation/gpu/i915.rst
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/display: Enable DP Display Audio WA (rev6)
In reply to Uma Shankar== Series Details ==
== Series Details ==
Series: drm/i915/display: Enable DP Display Audio WA (rev6)
URL : https://patchwork.freedesktop.org/series/75582/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_8309 -> Patchwork_17324
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/index.html
Known issues
------------
Here are the changes found in Patchwork_17324 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_pm_rpm@module-reload:
- fi-skl-6770hq: [PASS][1] -> [DMESG-WARN][2] ([i915#203]) +1 similar issue
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/fi-skl-6770hq/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/fi-skl-6770hq/igt@[email protected]
* igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence:
- fi-skl-6770hq: [PASS][3] -> [SKIP][4] ([fdo#109271]) +5 similar issues
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/fi-skl-6770hq/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/fi-skl-6770hq/igt@[email protected]
* igt@kms_pipe_crc_basic@read-crc-pipe-b:
- fi-skl-6770hq: [PASS][5] -> [DMESG-WARN][6] ([i915#106])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/fi-skl-6770hq/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/fi-skl-6770hq/igt@[email protected]
#### Possible fixes ####
* {igt@kms_flip@basic-flip-vs-wf_vblank@b-dvi-d1}:
- fi-bwr-2160: [FAIL][7] -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/fi-bwr-2160/igt@kms_flip@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/fi-bwr-2160/igt@kms_flip@[email protected]
#### Warnings ####
* igt@i915_pm_rpm@module-reload:
- fi-kbl-x1275: [SKIP][9] ([fdo#109271]) -> [FAIL][10] ([i915#62])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/fi-kbl-x1275/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/fi-kbl-x1275/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[i915#106]: https://gitlab.freedesktop.org/drm/intel/issues/106
[i915#203]: https://gitlab.freedesktop.org/drm/intel/issues/203
[i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
Participating hosts (52 -> 46)
------------------------------
Missing (6): fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-byt-clapper fi-bdw-samus
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_8309 -> Patchwork_17324
CI-20190529: 20190529
CI_DRM_8309: 7532b3183c849056c824828bafb4ab0b525e586e @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5593: 1c658f5e46598ae93345177d4981ef54704daec6 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_17324: 824059d46f5a1c38b53c179306d3872f6647df06 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
824059d46f5a drm/i915/display: Enable DP Display Audio WA
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✓ Fi.CI.IGT: success for drm/i915/display: Enable DP Display Audio WA (rev6)
In reply to Uma Shankar== Series Details ==
== Series Details ==
Series: drm/i915/display: Enable DP Display Audio WA (rev6)
URL : https://patchwork.freedesktop.org/series/75582/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_8309_full -> Patchwork_17324_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_17324_full:
### IGT changes ###
#### Suppressed ####
The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.
* {igt@kms_flip@flip-vs-suspend@a-edp1}:
- shard-skl: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/shard-skl7/igt@kms_flip@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/shard-skl8/igt@kms_flip@[email protected]
Known issues
------------
Here are the changes found in Patchwork_17324_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_ctx_persistence@legacy-engines-mixed-process@bsd:
- shard-apl: [PASS][3] -> [FAIL][4] ([i915#1528])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/shard-apl2/igt@gem_ctx_persistence@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/shard-apl6/igt@gem_ctx_persistence@[email protected]
* igt@gem_exec_params@invalid-bsd-ring:
- shard-iclb: [PASS][5] -> [SKIP][6] ([fdo#109276])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/shard-iclb4/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/shard-iclb5/igt@[email protected]
* igt@kms_cursor_crc@pipe-a-cursor-256x85-onscreen:
- shard-kbl: [PASS][7] -> [FAIL][8] ([i915#54] / [i915#93] / [i915#95])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/shard-kbl7/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/shard-kbl3/igt@[email protected]
- shard-apl: [PASS][9] -> [FAIL][10] ([i915#54] / [i915#95])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/shard-apl6/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/shard-apl7/igt@[email protected]
* igt@kms_cursor_crc@pipe-c-cursor-suspend:
- shard-kbl: [PASS][11] -> [DMESG-WARN][12] ([i915#180]) +2 similar issues
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/shard-kbl3/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/shard-kbl4/igt@[email protected]
* igt@kms_dp_dsc@basic-dsc-enable-edp:
- shard-iclb: [PASS][13] -> [SKIP][14] ([fdo#109349])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/shard-iclb2/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/shard-iclb6/igt@[email protected]
* igt@kms_hdr@bpc-switch:
- shard-skl: [PASS][15] -> [FAIL][16] ([i915#1188])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/shard-skl2/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/shard-skl10/igt@[email protected]
* igt@kms_psr@psr2_sprite_blt:
- shard-iclb: [PASS][17] -> [SKIP][18] ([fdo#109441]) +1 similar issue
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/shard-iclb2/igt@kms_psr@psr2_sprite_blt.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/shard-iclb3/igt@kms_psr@psr2_sprite_blt.html
#### Possible fixes ####
* igt@gem_ctx_persistence@legacy-engines-mixed-process@render:
- shard-skl: [FAIL][19] ([i915#1528]) -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/shard-skl4/igt@gem_ctx_persistence@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/shard-skl9/igt@gem_ctx_persistence@[email protected]
* igt@gem_ppgtt@blt-vs-render-ctx0:
- shard-tglb: [INCOMPLETE][21] -> [PASS][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/shard-tglb3/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/shard-tglb1/igt@[email protected]
* igt@i915_selftest@live@requests:
- shard-tglb: [INCOMPLETE][23] ([i915#1531] / [i915#1658]) -> [PASS][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/shard-tglb1/igt@i915_selftest@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/shard-tglb1/igt@i915_selftest@[email protected]
* igt@kms_cursor_crc@pipe-a-cursor-suspend:
- shard-iclb: [INCOMPLETE][25] ([i915#1185]) -> [PASS][26]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/shard-iclb3/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/shard-iclb8/igt@[email protected]
* igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions:
- shard-skl: [FAIL][27] ([IGT#5]) -> [PASS][28]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/shard-skl3/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/shard-skl7/igt@[email protected]
* igt@kms_cursor_legacy@pipe-b-torture-bo:
- shard-kbl: [DMESG-WARN][29] ([i915#128]) -> [PASS][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/shard-kbl1/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/shard-kbl2/igt@[email protected]
* igt@kms_draw_crc@draw-method-rgb565-render-untiled:
- shard-glk: [FAIL][31] ([i915#52] / [i915#54]) -> [PASS][32] +1 similar issue
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/shard-glk2/igt@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/shard-glk7/igt@[email protected]
* {igt@kms_flip@flip-vs-suspend-interruptible@a-dp1}:
- shard-kbl: [DMESG-WARN][33] ([i915#180]) -> [PASS][34] +7 similar issues
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/shard-kbl4/igt@kms_flip@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/shard-kbl2/igt@kms_flip@[email protected]
* igt@kms_frontbuffer_tracking@fbc-suspend:
- shard-kbl: [DMESG-WARN][35] ([i915#180] / [i915#93] / [i915#95]) -> [PASS][36] +1 similar issue
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/shard-kbl2/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/shard-kbl6/igt@[email protected]
- shard-apl: [DMESG-WARN][37] ([i915#180] / [i915#95]) -> [PASS][38] +1 similar issue
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/shard-apl4/igt@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/shard-apl2/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
- shard-skl: [FAIL][39] ([fdo#108145] / [i915#265]) -> [PASS][40]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/shard-skl6/igt@[email protected]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/shard-skl7/igt@[email protected]
* igt@kms_psr@psr2_sprite_plane_move:
- shard-iclb: [SKIP][41] ([fdo#109441]) -> [PASS][42] +2 similar issues
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/shard-iclb1/igt@kms_psr@psr2_sprite_plane_move.html
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/shard-iclb2/igt@kms_psr@psr2_sprite_plane_move.html
* igt@kms_setmode@basic:
- shard-skl: [FAIL][43] ([i915#31]) -> [PASS][44]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/shard-skl3/igt@[email protected]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/shard-skl9/igt@[email protected]
#### Warnings ####
* igt@i915_pm_dc@dc3co-vpb-simulation:
- shard-iclb: [SKIP][45] ([i915#658]) -> [SKIP][46] ([i915#588])
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/shard-iclb1/igt@[email protected]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/shard-iclb2/igt@[email protected]
* igt@kms_setmode@basic:
- shard-apl: [FAIL][47] ([i915#31] / [i915#95]) -> [FAIL][48] ([i915#31])
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/shard-apl1/igt@[email protected]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/shard-apl8/igt@[email protected]
* igt@kms_vblank@pipe-c-ts-continuation-dpms-suspend:
- shard-tglb: [INCOMPLETE][49] ([i915#456] / [i915#460]) -> [INCOMPLETE][50] ([i915#456])
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8309/shard-tglb5/igt@[email protected]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/shard-tglb8/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[IGT#5]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/5
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
[fdo#109349]: https://bugs.freedesktop.org/show_bug.cgi?id=109349
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[i915#1185]: https://gitlab.freedesktop.org/drm/intel/issues/1185
[i915#1188]: https://gitlab.freedesktop.org/drm/intel/issues/1188
[i915#128]: https://gitlab.freedesktop.org/drm/intel/issues/128
[i915#1528]: https://gitlab.freedesktop.org/drm/intel/issues/1528
[i915#1531]: https://gitlab.freedesktop.org/drm/intel/issues/1531
[i915#1542]: https://gitlab.freedesktop.org/drm/intel/issues/1542
[i915#1658]: https://gitlab.freedesktop.org/drm/intel/issues/1658
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
[i915#31]: https://gitlab.freedesktop.org/drm/intel/issues/31
[i915#456]: https://gitlab.freedesktop.org/drm/intel/issues/456
[i915#460]: https://gitlab.freedesktop.org/drm/intel/issues/460
[i915#52]: https://gitlab.freedesktop.org/drm/intel/issues/52
[i915#54]: https://gitlab.freedesktop.org/drm/intel/issues/54
[i915#588]: https://gitlab.freedesktop.org/drm/intel/issues/588
[i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
[i915#93]: https://gitlab.freedesktop.org/drm/intel/issues/93
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95
Participating hosts (10 -> 10)
------------------------------
No changes in participating hosts
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_8309 -> Patchwork_17324
CI-20190529: 20190529
CI_DRM_8309: 7532b3183c849056c824828bafb4ab0b525e586e @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5593: 1c658f5e46598ae93345177d4981ef54704daec6 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_17324: 824059d46f5a1c38b53c179306d3872f6647df06 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17324/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 24 lines
-----Original Message-----
From: Shankar, Uma <[email protected]>
Sent: Thursday, April 16, 2020 4:24 PM
To: [email protected]
Cc: Vehmanen, Kai <[email protected]>; Gupta, Anshuman <[email protected]>; [email protected]; Shankar, Uma <[email protected]>
Subject: [v6] drm/i915/display: Enable DP Display Audio WAFor certain DP VDSC bpp settings, hblank asserts before
hblank_early, leading to a bad audio state. Driver need to program "hblank early enable" and "samples per line" parameters inAUDIO_CONFIG_BEregister.This is Display Audio WA #1406928334 for 4k+VDSC usecase applicable on DP encoders. Implemented the same.
v2: Fixed build failures on 32bit machine.
v3: Dropped u64, added helpers for sample room calculation,
other general comments as per Jani Nikula's feedback. Also fixed connector type check (spotted by Anshuman)
Quoted 6 lines
v4: Addressed Jani Nikula and Kai's review comments.
v5: Addressed Anshuman's review comment and used crtc_* variable
to get timings.v6: Dropped a redundant initialization.
Change pushed to dinq. Thanks for the review.
Quoted 204 lines
Reviewed-by Anshuman Gupta <[email protected]>Signed-off-by Uma Shankar <[email protected]>--- drivers/gpu/drm/i915/display/intel_audio.c | 146 +++++++++++++++++++++ drivers/gpu/drm/i915/i915_reg.h | 16 +++ 2 files changed, 162 insertions(+)drivers/gpu/drm/i915/display/intel_audio.c +112
-0@@ -514,6 +514,148 @@ static void hsw_audio_codec_disable(struct intel_encoder *encoder,mutex_unlock (&dev_priv->av_mutex); } +/* Add a factor to take care of rounding and truncations */ #define +ROUNDING_FACTOR 10000 + +static unsigned int get_hblank_early_enable_config (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state) { +struct drm_i915_private *i915 =to_i915 (encoder->base.dev); +unsigned int link_clks_available, link_clks_required; +unsigned int tu_data, tu_line, link_clks_active; +unsigned int hblank_rise, hblank_early_prog; +unsigned int h_active, h_total, hblank_delta, pixel_clk, v_total; +unsigned int fec_coeff, refresh_rate, cdclk, vdsc_bpp; + + h_active = crtc_state->hw.adjusted_mode.crtc_hdisplay; + h_total = crtc_state->hw.adjusted_mode.crtc_htotal; + v_total = crtc_state->hw.adjusted_mode.crtc_vtotal; + pixel_clk = crtc_state->hw.adjusted_mode.crtc_clock; + refresh_rate = crtc_state->hw.adjusted_mode.vrefresh; + vdsc_bpp = crtc_state->dsc.compressed_bpp; + cdclk = i915->cdclk.hw.cdclk; +/* fec= 0.972261, using rounding multiplier of 1000000 */ + fec_coeff =972261 ; + +drm_dbg_kms (&i915->drm,"h_active = %u link_clk = %u :" +"lanes = %u vdsc_bpp = %u cdclk = %u\n" , + h_active, crtc_state->port_clock, crtc_state->lane_count, + vdsc_bpp, cdclk); + + link_clks_available = ((((h_total - h_active) * + ((crtc_state->port_clock *ROUNDING_FACTOR ) / + pixel_clk)) /ROUNDING_FACTOR ) -28 ); + + link_clks_required =DIV_ROUND_UP (192000 , (refresh_rate * + v_total)) * ((48 / + crtc_state->lane_count) +2 ); + +if (link_clks_available > link_clks_required) + hblank_delta =32 ; +else + hblank_delta =DIV_ROUND_UP (((((5 *ROUNDING_FACTOR ) / + crtc_state->port_clock) + ((5 * +ROUNDING_FACTOR ) / + cdclk)) * pixel_clk), +ROUNDING_FACTOR ); + + tu_data = (pixel_clk * vdsc_bpp *8 ) / ((crtc_state->port_clock * + crtc_state->lane_count * fec_coeff) /1000000 ); + tu_line = (((h_active * crtc_state->port_clock * fec_coeff) / +1000000 ) / (64 * pixel_clk)); + link_clks_active = (tu_line -1 ) *64 + tu_data; + + hblank_rise = ((link_clks_active +6 *DIV_ROUND_UP (link_clks_active, +250 ) +4 ) * ((pixel_clk *ROUNDING_FACTOR ) / + crtc_state->port_clock)) /ROUNDING_FACTOR ; + + hblank_early_prog = h_active - hblank_rise + hblank_delta; + +return hblank_early_prog; +} + +static unsigned int get_sample_room_req_config (const struct +intel_crtc_state *crtc_state) { +unsigned int h_active, h_total, pixel_clk; +unsigned int samples_room; + + h_active = crtc_state->hw.adjusted_mode.hdisplay; + h_total = crtc_state->hw.adjusted_mode.htotal; + pixel_clk = crtc_state->hw.adjusted_mode.clock; + + samples_room = ((((h_total - h_active) * ((crtc_state->port_clock * +ROUNDING_FACTOR ) / pixel_clk)) / +ROUNDING_FACTOR ) -12 ) / ((48 / + crtc_state->lane_count) +2 ); + +return samples_room; +} + +static void enable_audio_dsc_wa (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state) { +struct drm_i915_private *i915 =to_i915 (encoder->base.dev); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); +enum pipe pipe = crtc->pipe; +unsigned int hblank_early_prog, samples_room, h_active; +unsigned int val; + +if (INTEL_GEN (i915) <11 ) +return ; + + h_active = crtc_state->hw.adjusted_mode.hdisplay; + +if (!(h_active && crtc_state->port_clock && crtc_state->lane_count && + crtc_state->dsc.compressed_bpp && i915->cdclk.hw.cdclk)) { +drm_err (&i915->drm,"Null Params rcvd for hblank early enabling\n"); +WARN_ON (1 ); +return ; + } + + val =intel_de_read (i915,AUD_CONFIG_BE ); + +if (INTEL_GEN (i915) ==11 ) + val |=HBLANK_EARLY_ENABLE_ICL (pipe); +else if (INTEL_GEN (i915) >=12 ) + val |=HBLANK_EARLY_ENABLE_TGL (pipe); + +if (crtc_state->dsc.compression_enable && + (crtc_state->hw.adjusted_mode.hdisplay >=3840 && + crtc_state->hw.adjusted_mode.vdisplay >=2160 )) { +/* Get hblank early enable value required */ + hblank_early_prog =get_hblank_early_enable_config (encoder, + crtc_state); +if (hblank_early_prog <32 ) { + val &= ~HBLANK_START_COUNT_MASK (pipe); + val |= HBLANK_START_COUNT(pipe,
HBLANK_START_COUNT_32);drivers/gpu/drm/i915/display/intel_audio.c +3
-0+ }else if (hblank_early_prog <64 ) { + val &= ~HBLANK_START_COUNT_MASK (pipe); + val |= HBLANK_START_COUNT(pipe,
HBLANK_START_COUNT_64);drivers/gpu/drm/i915/display/intel_audio.c +3
-0+ }else if (hblank_early_prog <96 ) { + val &= ~HBLANK_START_COUNT_MASK (pipe); + val |= HBLANK_START_COUNT(pipe,
HBLANK_START_COUNT_96);drivers/gpu/drm/i915/display/intel_audio.c +3
-0+ }else { + val &= ~HBLANK_START_COUNT_MASK (pipe); + val |= HBLANK_START_COUNT(pipe,
HBLANK_START_COUNT_128);drivers/gpu/drm/i915/display/intel_audio.c +22
-0+ } + +/* Get samples room value required */ + samples_room =get_sample_room_req_config (crtc_state); +if (samples_room <3 ) { + val &= ~NUMBER_SAMPLES_PER_LINE_MASK (pipe); + val |=NUMBER_SAMPLES_PER_LINE (pipe, samples_room); + }else { +/* Program 0 i.e "All Samples available in buffer" */ + val &= ~NUMBER_SAMPLES_PER_LINE_MASK (pipe); + val |=NUMBER_SAMPLES_PER_LINE (pipe,0x0 ); + } + } + +intel_de_write (i915,AUD_CONFIG_BE , val); } + +#undef ROUNDING_FACTOR +static void hsw_audio_codec_enable (struct intel_encoder *encoder,const struct intel_crtc_state *crtc_state,const struct drm_connector_state *conn_state)@@ -531,6 +673,10 @@ static void hsw_audio_codec_enable(struct intel_encoder *encoder,mutex_lock (&dev_priv->av_mutex); +/* Enable Audio WA for 4k DSC usecases */ +if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_DP )) +enable_audio_dsc_wa (encoder, crtc_state); +/* Enable audio presence detect, invalidate ELD */ tmp =intel_de_read (dev_priv,HSW_AUD_PIN_ELD_CP_VLD );drivers/gpu/drm/i915/display/intel_audio.c +0
-0tmp |=AUDIO_OUTPUT_ENABLE (cpu_transcoder);drivers/gpu/drm/i915/i915_reg.h +16
-0@@ -9396,6 +9396,22 @@ enum {#define AUD_PIN_BUF_CTL _MMIO(0x48414)#define AUD_PIN_BUF_ENABLE REG_BIT(31) +/* Display Audio Config Reg */ +#define AUD_CONFIG_BE _MMIO(0x65ef0) +#define HBLANK_EARLY_ENABLE_ICL (pipe) (0x1 << (20 - (pipe))) +#define HBLANK_EARLY_ENABLE_TGL (pipe) (0x1 << (24 + (pipe))) +#define HBLANK_START_COUNT_MASK (pipe) (0x7 << (3 + ((pipe) * 6))) +#define HBLANK_START_COUNT (pipe, val) (((val) & 0x7) << (3 + ((pipe)) * 6)) +#define NUMBER_SAMPLES_PER_LINE_MASK (pipe) (0x3 << ((pipe) * 6)) +#define NUMBER_SAMPLES_PER_LINE (pipe, val) (((val) & 0x3) << ((pipe) * 6)) + +#define HBLANK_START_COUNT_8 0 +#define HBLANK_START_COUNT_16 1 +#define HBLANK_START_COUNT_32 2 +#define HBLANK_START_COUNT_64 3 +#define HBLANK_START_COUNT_96 4 +#define HBLANK_START_COUNT_128 5 +/*
Quoted 4 lines
* HSW - ICL power wells
*
--
2.22.0
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoting Shankar, Uma (2020-04-17 12:49:21)
Quoted 24 lines
Quoted 24 lines
-----Original Message-----
From: Shankar, Uma <[email protected]>
Sent: Thursday, April 16, 2020 4:24 PM
To: [email protected]
Cc: Vehmanen, Kai <[email protected]>; Gupta, Anshuman <[email protected]>; [email protected]; Shankar, Uma <[email protected]>
Subject: [v6] drm/i915/display: Enable DP Display Audio WAFor certain DP VDSC bpp settings, hblank asserts before
hblank_early, leading to a bad audio state. Driver need to program "hblank early enable" and "samples per line" parameters inAUDIO_CONFIG_BEregister.This is Display Audio WA #1406928334 for 4k+VDSC usecase applicable on DP encoders. Implemented the same.
v2: Fixed build failures on 32bit machine.
v3: Dropped u64, added helpers for sample room calculation,
other general comments as per Jani Nikula's feedback. Also fixed connector type check (spotted by Anshuman)
Quoted 8 lines
Quoted 6 lines
v4: Addressed Jani Nikula and Kai's review comments.
v5: Addressed Anshuman's review comment and used crtc_* variable
to get timings.v6: Dropped a redundant initialization.
Change pushed to dinq. Thanks for the review.
You pushed even though it was failing in boot?
Please fix or revert.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx