drm/i915: Enable second dbuf slice for ICL and TGL
Subsystems (3)
PATCH v8 1/1 drm/i915: Enable second dbuf slice for ICL and TGL
Also implemented algorithm for choosing DBuf slice configuration based on active pipes, pipe ratio as stated in BSpec 12716.
Now pipe allocation still stays proportional to pipe width as before, however within allowed DBuf slice for this particular configuration.
v2: Remove unneeded check from commit as ddb enabled slices might
now differ from hw state.
v3: - Added new field "supported_slices" to ddb to separate max
supported slices vs currently enabled, to avoid confusion.
- Removed obsolete comments and code related to DBuf(Matthew Roper).
- Some code style and long line removal(Matthew Roper).
- Added WARN_ON to new ddb range offset calc function(Matthew Roper).
- Removed platform specific call to calc pipe ratio from ddb allocation function and fixed the return value(Matthew Roper)
- Refactored DBUF slice allocation table to improve readability
- Added DBUF slice allocation for TGL as well.
- ICL(however not TGL) seems to voluntarily enable second DBuf slice after pm suspend/resume causing a mismatch failure, because we update DBuf slices only if we do a modeset, however this check is done always. Fixed it to be done only when modeset for ICL.
v4: - Now enabled slices is not actually a number, but a bitmask,
because we might need to enable second slice only and number of slices would still 1 and that current code doesn't allow.
- Remove redundant duplicate code to have some unified way of enabling dbuf slices instead of hardcoding.
v5: - Fix failing gen9_assert_dbuf_enabled as it was naively thinking
that we have only one DBUF_CTL slice. Now another version for gen11 will check both slices as only second one can be enabled, to keep CI happy.
v6: - Removed enabled dbuf assertion completely. Previous code
was keeping dbuf enabled, even(!) when _dbuf_disable is called. Currently we enable/disable dbuf slices based on requrement so no point in asserting this here.
- Removed unnecessary modeset check from verify_wm_state(Matthew Roper)
- Slices intersection after union is same
as final result(Matthew Roper)
- Moved DBuf slices to intel_device_info(Matthew Roper)
- Some macros added(Matthew Roper)
- ddb range is now always less or equal to ddb size - no need for additional checks(previously needed as we had some bandwidth checks in there which could "suddenly" return ddb_size smaller than it is.
v7: Minor costemic changes:
- Changed icl_dbuf_slices_restore name to icl_program_dbuf_slices as it more corresponds to the actual functionality.
- Some simplification with supported slices for BXT and GLK
- skl_pipe_downscale_amount -> icl_pipe_downscale_amount as this is not used for skl anymore.
- Changed DBuf slice assignment order for TGL case
v8: Fix checkpatch/sparse warnings.
--- drivers/gpu/drm/i915/display/intel_display.c | 26 +- .../drm/i915/display/intel_display_power.c | 98 ++--- .../drm/i915/display/intel_display_power.h | 2 + drivers/gpu/drm/i915/i915_drv.c | 5 + drivers/gpu/drm/i915/i915_drv.h | 2 +- drivers/gpu/drm/i915/i915_pci.c | 6 +- drivers/gpu/drm/i915/i915_reg.h | 8 +- drivers/gpu/drm/i915/intel_device_info.h | 1 + drivers/gpu/drm/i915/intel_pm.c | 386 ++++++++++++++++-- 9 files changed, 430 insertions(+), 104 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +19 -7
@@ -13387,7 +13387,7 @@ static void verify_wm_state(struct intel_crtc *crtc,if (INTEL_GEN (dev_priv) >=11 && hw->ddb.enabled_slices != sw_ddb->enabled_slices) -DRM_ERROR ("mismatch in DBUF Slices (expected %u, got %u)\n" , +DRM_ERROR ("mismatch in DBUF Slices (expected %x, got %x)\n" , sw_ddb->enabled_slices, hw->ddb.enabled_slices);
@@ -14619,15 +14619,24 @@ static void skl_commit_modeset_enables(struct intel_atomic_state *state)u8 hw_enabled_slices = dev_priv->wm.skl_hw.ddb.enabled_slices;u8 required_slices = state->wm_results.ddb.enabled_slices;struct skl_ddb_entry entries[I915_MAX_PIPES ] = {}; +u8 slices_union = hw_enabled_slices | required_slices; +u8 slices_intersection = required_slices;for_each_oldnew_intel_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i)/* ignore allocations for crtc's that have been turned off. */ if (new_crtc_state->hw.active) entries[i] = old_crtc_state->wm.skl.ddb; -/* If 2nd DBuf slice required, enable it here */ -if (INTEL_GEN (dev_priv) >=11 && required_slices > hw_enabled_slices) -icl_dbuf_slices_update (dev_priv, required_slices); +DRM_DEBUG_KMS ("DBuf req slices %d hw slices %d\n" , + required_slices, hw_enabled_slices); + +/* +* If some other DBuf slice required, enable it here, +* as here we only add more slices, but not remove to prevent +* issues if somebody still uses those. +*/ +if (INTEL_GEN (dev_priv) >=11 && required_slices != hw_enabled_slices) +icl_dbuf_slices_update (dev_priv, slices_union);/* * Whenever the number of active pipes changes, we need to make sure we
@@ -14686,9 +14695,12 @@ static void skl_commit_modeset_enables(struct intel_atomic_state *state) } }while (progress); -/* If 2nd DBuf slice is no more required disable it */ -if (INTEL_GEN (dev_priv) >=11 && required_slices < hw_enabled_slices) -icl_dbuf_slices_update (dev_priv, required_slices); +/* +* If some other DBuf slice is not needed, disable it here, +* as here we only remove slices, which are not needed anymore. +*/ +if (INTEL_GEN (dev_priv) >=11 && required_slices != hw_enabled_slices) +icl_dbuf_slices_update (dev_priv, slices_intersection); }static void intel_atomic_helper_free_state (struct drm_i915_private *dev_priv)
drivers/gpu/drm/i915/display/intel_display_power.c +44 -54
138 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_display_power.h +2 -0
@@ -311,8 +311,10 @@ intel_display_power_put_async(struct drm_i915_private *i915,for ((wf) =intel_display_power_get ((i915), (domain)); (wf); \intel_display_power_put_async ((i915), (domain), (wf)), (wf) =0 ) +int intel_dbuf_max_slices(struct drm_i915_private *dev_priv);void icl_dbuf_slices_update (struct drm_i915_private *dev_priv,u8 req_slices); +void icl_program_dbuf_slices (struct drm_i915_private *dev_priv);void chv_phy_powergate_lanes (struct intel_encoder *encoder,bool override,unsigned int mask);
drivers/gpu/drm/i915/i915_drv.c +5 -0
@@ -51,6 +51,7 @@#include "display/intel_bw.h" #include "display/intel_cdclk.h" #include "display/intel_display_types.h" +#include "display/intel_display_power.h" #include "display/intel_dp.h" #include "display/intel_fbdev.h" #include "display/intel_hotplug.h"
@@ -2591,6 +2592,10 @@ static int intel_runtime_resume(struct device *kdev)if (IS_VALLEYVIEW (dev_priv) ||IS_CHERRYVIEW (dev_priv)) ret =vlv_resume_prepare (dev_priv, true); +/* Weird hack to fix ICL hardware bug, as it resets DBUF slices reg */ +if (INTEL_GEN (dev_priv) ==11 ) +icl_program_dbuf_slices (dev_priv); +intel_uncore_runtime_resume (&dev_priv->uncore);intel_runtime_pm_enable_interrupts (dev_priv);
drivers/gpu/drm/i915/i915_drv.h +1 -1
@@ -799,7 +799,7 @@ static inline bool skl_ddb_entry_equal(const struct skl_ddb_entry *e1, }struct skl_ddb_allocation { -u8 enabled_slices;/* GEN11 has configurable 2 slices */ +u8 enabled_slices;/* Bitmask of currently enabled DBuf slices */ };struct skl_ddb_values {
drivers/gpu/drm/i915/i915_pci.c +5 -1
@@ -614,7 +614,8 @@ static const struct intel_device_info intel_cherryview_info = { .has_gt_uc = 1, \ .display.has_hdcp = 1, \ .display.has_ipc = 1, \ - .ddb_size = 896 + .ddb_size = 896, \ + .supported_slices = 1#define SKL_PLATFORM \ GEN9_FEATURES, \
@@ -650,6 +651,7 @@ static const struct intel_device_info intel_skylake_gt4_info = { GEN(9), \ .is_lp = 1, \ .display.has_hotplug = 1, \ + .supported_slices = 1, \ .engine_mask = BIT(RCS0) | BIT(VCS0) | BIT(BCS0) | BIT(VECS0), \ .pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C), \ .has_64bit_reloc = 1, \
@@ -737,6 +739,7 @@ static const struct intel_device_info intel_coffeelake_gt3_info = {GEN9_FEATURES , \GEN (10 ), \ .ddb_size = 1024, \ + .supported_slices = 1, \ .display.has_dsc = 1, \ .has_coherent_ggtt = false, \GLK_COLORS
@@ -773,6 +776,7 @@ static const struct intel_device_info intel_cannonlake_info = { }, \ GEN(11), \ .ddb_size = 2048, \ + .supported_slices = 2, \ .has_logical_ring_elsq = 1, \ .color = { .degamma_lut_size = 33, .gamma_lut_size = 262145 }
drivers/gpu/drm/i915/i915_reg.h +5 -3
@@ -7754,9 +7754,11 @@ enum {#define DISP_ARB_CTL2 _MMIO(0x45004)#define DISP_DATA_PARTITION_5_6 (1 << 6)#define DISP_IPC_ENABLE (1 << 3) -#define DBUF_CTL _MMIO(0x45008) -#define DBUF_CTL_S1 _MMIO(0x45008) -#define DBUF_CTL_S2 _MMIO(0x44FE8) +#define DBUF_S1_BIT BIT(0) +#define DBUF_S2_BIT BIT(1) +#define DBUF_CTL _MMIO(0x45008) +#define DBUF_CTL_S1 _MMIO(0x45008) +#define DBUF_CTL_S2 _MMIO(0x44FE8)#define DBUF_POWER_REQUEST (1 << 31)#define DBUF_POWER_STATE (1 << 30)#define GEN7_MSG_CTL _MMIO(0x45010)
drivers/gpu/drm/i915/intel_device_info.h +1 -0
@@ -180,6 +180,7 @@ struct intel_device_info { } display;u16 ddb_size;/* in blocks */ +u8 supported_slices;/* number of DBuf slices */ /* Register offsets for the various display pipes and transcoders */ int pipe_offsets[I915_MAX_TRANSCODERS ];
drivers/gpu/drm/i915/intel_pm.c +348 -38
470 lines not on this page · raw message
Signature · 6 lines
2.17.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.CHECKPATCH: warning for drm/i915: Enable second dbuf slice for ICL and TGL (rev5)
== Series Details ==
== Series Details ==
Series: drm/i915: Enable second dbuf slice for ICL and TGL (rev5)
URL : https://patchwork.freedesktop.org/series/69124/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip f62897cea199 drm/i915: Enable second dbuf slice for ICL and TGL -:281: WARNING:SUSPECT_CODE_INDENT: suspect code indent for conditional statements (8, 0) #281: FILE: drivers/gpu/drm/i915/display/intel_display_power.h:311: for ((wf) = intel_display_power_get((i915), (domain)); (wf); \ [...] +int intel_dbuf_max_slices(struct drm_i915_private *dev_priv);
-:487: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #487: FILE: drivers/gpu/drm/i915/intel_pm.c:3848:
+static u32 i915_allowed_dbuf_mask(struct drm_i915_private *dev_priv,
+ int pipe, u32 active_pipes,
-:691: CHECK:LINE_SPACING: Please don't use multiple blank lines #691: FILE: drivers/gpu/drm/i915/intel_pm.c:4301:
+
+
-:695: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #695: FILE: drivers/gpu/drm/i915/intel_pm.c:4305:
+ DRM_DEBUG_KMS("Pipe %d downscale amount %d.%d\n",
+ crtc->pipe, pipe_downscale.val >> 16,
-:717: CHECK:LINE_SPACING: Please don't use multiple blank lines #717: FILE: drivers/gpu/drm/i915/intel_pm.c:4327:
+
+
-:718: CHECK:CAMELCASE: Avoid CamelCase: <Dbuf1>
#718: FILE: drivers/gpu/drm/i915/intel_pm.c:4328:
+#define ICL_PIPE_A_DBUF_SLICES(Dbuf1) \
-:726: CHECK:CAMELCASE: Avoid CamelCase: <Dbuf2>
#726: FILE: drivers/gpu/drm/i915/intel_pm.c:4336:
+#define ICL_PIPE_AB_DBUF_SLICES(Dbuf1, Dbuf2) \
-:738: CHECK:CAMELCASE: Avoid CamelCase: <Dbuf3> #738: FILE: drivers/gpu/drm/i915/intel_pm.c:4348:
+#define ICL_PIPE_ABC_DBUF_SLICES(Dbuf1, Dbuf2, Dbuf3) \
-:748: CHECK:CAMELCASE: Avoid CamelCase: <Dbuf4>
#748: FILE: drivers/gpu/drm/i915/intel_pm.c:4358:
+#define ICL_PIPE_ABCD_DBUF_SLICES(Dbuf1, Dbuf2, Dbuf3, Dbuf4) \
total: 0 errors, 1 warnings, 8 checks, 744 lines checked
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.SPARSE: warning for drm/i915: Enable second dbuf slice for ICL and TGL (rev5)
In reply to Stanislav Lisovskiy== Series Details ==
== Series Details ==
Series: drm/i915: Enable second dbuf slice for ICL and TGL (rev5)
URL : https://patchwork.freedesktop.org/series/69124/
State : warning
== Summary ==
$ dim sparse origin/drm-tip Sparse version: v0.6.0 Commit: drm/i915: Enable second dbuf slice for ICL and TGL +drivers/gpu/drm/i915/intel_pm.c:4466:5: warning: symbol 'i915_allowed_dbuf_mask' was not declared. Should it be static?
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for drm/i915: Enable second dbuf slice for ICL and TGL (rev5)
In reply to Stanislav Lisovskiy== Series Details ==
== Series Details ==
Series: drm/i915: Enable second dbuf slice for ICL and TGL (rev5)
URL : https://patchwork.freedesktop.org/series/69124/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_7385 -> Patchwork_15343
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15343/index.html
Known issues
------------
Here are the changes found in Patchwork_15343 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_pm_rpm@module-reload:
- fi-skl-6770hq: [PASS][1] -> [FAIL][2] ([fdo#108511])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7385/fi-skl-6770hq/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15343/fi-skl-6770hq/igt@[email protected]
* igt@i915_selftest@live_blt:
- fi-bsw-nick: [PASS][3] -> [DMESG-FAIL][4] ([fdo#112176])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7385/fi-bsw-nick/igt@i915_selftest@live_blt.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15343/fi-bsw-nick/igt@i915_selftest@live_blt.html
* igt@i915_selftest@live_hangcheck:
- fi-hsw-4770r: [PASS][5] -> [DMESG-FAIL][6] ([fdo#111991])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7385/fi-hsw-4770r/igt@i915_selftest@live_hangcheck.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15343/fi-hsw-4770r/igt@i915_selftest@live_hangcheck.html
* igt@kms_chamelium@hdmi-crc-fast:
- fi-icl-u2: [PASS][7] -> [FAIL][8] ([fdo#109635 ])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7385/fi-icl-u2/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15343/fi-icl-u2/igt@[email protected]
#### Possible fixes ####
* igt@kms_frontbuffer_tracking@basic:
- fi-icl-u2: [FAIL][9] ([fdo#103167]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7385/fi-icl-u2/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15343/fi-icl-u2/igt@[email protected]
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#108511]: https://bugs.freedesktop.org/show_bug.cgi?id=108511
[fdo#109635 ]: https://bugs.freedesktop.org/show_bug.cgi?id=109635
[fdo#111991]: https://bugs.freedesktop.org/show_bug.cgi?id=111991
[fdo#112176]: https://bugs.freedesktop.org/show_bug.cgi?id=112176
Participating hosts (49 -> 45)
------------------------------
Additional (2): fi-cfl-8700k fi-kbl-7500u
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_7385 -> Patchwork_15343
CI-20190529: 20190529
CI_DRM_7385: 3696e1a31bcf77ea17bdfd1ee278057262365c10 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5298: a19df6f52812517a4a84e6e630506512575b10da @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_15343: f62897cea199bddd506ba2cb25b2652b22dba82e @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
f62897cea199 drm/i915: Enable second dbuf slice for ICL and TGL
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15343/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx