drm/i915: Enable display workaround 827 for all planes, v2.
Subsystems (2)
PATCH 1/1 drm/i915: Enable display workaround 827 for all planes, v2.
The workaround was applied only to the primary plane, but is required on all planes. Iterate over all planes in the crtc atomic check to see if the workaround is enabled, and only perform the actual toggling in the pre/post plane update functions.
Changes since v1:
- Track active NV12 planes in a nv12_planes bitmask. (Ville)
--- drivers/gpu/drm/i915/intel_atomic_plane.c | 7 +++++- drivers/gpu/drm/i915/intel_display.c | 40 ++++++++++++++++++------------- drivers/gpu/drm/i915/intel_drv.h | 1 + 3 files changed, 30 insertions(+), 18 deletions(-)
drivers/gpu/drm/i915/intel_atomic_plane.c +6 -1
@@ -183,11 +183,16 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ }/* FIXME pre-g4x don't work like this */ -if (intel_state->base.visible) +if (state->visible) crtc_state->active_planes |=BIT (intel_plane->id);else crtc_state->active_planes &= ~BIT (intel_plane->id); +if (state->visible && state->fb->format->format ==DRM_FORMAT_NV12 ) + crtc_state->nv12_planes |=BIT (intel_plane->id); +else + crtc_state->nv12_planes &= ~BIT (intel_plane->id); + return intel_plane_atomic_calc_changes(old_crtc_state, &crtc_state->base, old_plane_state,
drivers/gpu/drm/i915/intel_display.c +23 -17
@@ -5138,6 +5138,19 @@ static bool hsw_post_update_enable_ips(const struct intel_crtc_state *old_crtc_sreturn !old_crtc_state->ips_enabled; } +static bool needs_nv12_wa (struct drm_i915_private *dev_priv, +const struct intel_crtc_state *crtc_state) +{ +if (!crtc_state->nv12_planes) +return false; + +if ((INTEL_GEN (dev_priv) ==9 && !IS_GEMINILAKE (dev_priv)) || +IS_CANNONLAKE (dev_priv)) +return true; + +return false; +} +static void intel_post_plane_update (struct intel_crtc_state *old_crtc_state) {struct intel_crtc *crtc =to_intel_crtc (old_crtc_state->base.crtc);
@@ -5162,7 +5175,6 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state)if (old_primary_state) {struct drm_plane_state *new_primary_state =drm_atomic_get_new_plane_state (old_state, primary); -struct drm_framebuffer *fb = new_primary_state->fb;intel_fbc_post_update (crtc);
@@ -5170,15 +5182,12 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state) (needs_modeset(&pipe_config->base) || !old_primary_state->visible))intel_post_enable_primary (&crtc->base, pipe_config); - -/* Display WA 827 */ -if ((INTEL_GEN (dev_priv) ==9 && !IS_GEMINILAKE (dev_priv)) || -IS_CANNONLAKE (dev_priv)) { -if (fb && fb->format->format ==DRM_FORMAT_NV12 ) -skl_wa_clkgate (dev_priv, crtc->pipe, false); - } - } + +/* Display WA 827 */ +if (needs_nv12_wa (dev_priv, old_crtc_state) && + !needs_nv12_wa (dev_priv, pipe_config)) +skl_wa_clkgate (dev_priv, crtc->pipe, false); } static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,
@@ -5202,14 +5211,6 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,struct intel_plane_state *new_primary_state =intel_atomic_get_new_plane_state (old_intel_state,to_intel_plane (primary)); -struct drm_framebuffer *fb = new_primary_state->base.fb; - -/* Display WA 827 */ -if ((INTEL_GEN (dev_priv) ==9 && !IS_GEMINILAKE (dev_priv)) || -IS_CANNONLAKE (dev_priv)) { -if (fb && fb->format->format ==DRM_FORMAT_NV12 ) -skl_wa_clkgate (dev_priv, crtc->pipe, true); - }intel_fbc_pre_update (crtc, pipe_config, new_primary_state);/*
@@ -5221,6 +5222,11 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,intel_set_cpu_fifo_underrun_reporting (dev_priv, crtc->pipe, false); } +/* Display WA 827 */ +if (!needs_nv12_wa (dev_priv, old_crtc_state) && +needs_nv12_wa (dev_priv, pipe_config)) +skl_wa_clkgate (dev_priv, crtc->pipe, true); +/* * Vblank time updates from the shadow to live plane control register * are blocked if the memory self-refresh mode is active at that
drivers/gpu/drm/i915/intel_drv.h +1 -0
@@ -882,6 +882,7 @@ struct intel_crtc_state {/* bitmask of visible planes (enum plane_id) */ u8 active_planes; +u8 nv12_planes;/* HDMI scrambling status */ bool hdmi_scrambling;
Signature · 6 lines
2.16.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 107 lines · Maarten Lankhorst
The workaround was applied only to the primary plane, but is required on all planes. Iterate over all planes in the crtc atomic check to see if the workaround is enabled, and only perform the actual toggling in the pre/post plane update functions.
Changes since v1:
- Track active NV12 planes in anv12_planesbitmask. (Ville)Signed-off-by Maarten Lankhorst <[email protected]>Cc Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_atomic_plane.c | 7 +++++- drivers/gpu/drm/i915/intel_display.c | 40 ++++++++++++++++++------------- drivers/gpu/drm/i915/intel_drv.h | 1 + 3 files changed, 30 insertions(+), 18 deletions(-)drivers/gpu/drm/i915/intel_atomic_plane.c +6
-1@@ -183,11 +183,16 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ }/* FIXME pre-g4x don't work like this */ -if (intel_state->base.visible) +if (state->visible) crtc_state->active_planes |=BIT (intel_plane->id);else crtc_state->active_planes &= ~BIT (intel_plane->id); +if (state->visible && state->fb->format->format ==DRM_FORMAT_NV12 ) + crtc_state->nv12_planes |=BIT (intel_plane->id); +else + crtc_state->nv12_planes &= ~BIT (intel_plane->id); + return intel_plane_atomic_calc_changes(old_crtc_state, &crtc_state->base, old_plane_state,drivers/gpu/drm/i915/intel_display.c +18
-17@@ -5138,6 +5138,19 @@ static bool hsw_post_update_enable_ips(const struct intel_crtc_state *old_crtc_sreturn !old_crtc_state->ips_enabled; } +static bool needs_nv12_wa (struct drm_i915_private *dev_priv, +const struct intel_crtc_state *crtc_state) +{ +if (!crtc_state->nv12_planes) +return false; + +if ((INTEL_GEN (dev_priv) ==9 && !IS_GEMINILAKE (dev_priv)) || +IS_CANNONLAKE (dev_priv)) +return true; + +return false; +} +static void intel_post_plane_update (struct intel_crtc_state *old_crtc_state) {struct intel_crtc *crtc =to_intel_crtc (old_crtc_state->base.crtc);@@ -5162,7 +5175,6 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state)if (old_primary_state) {struct drm_plane_state *new_primary_state =drm_atomic_get_new_plane_state (old_state, primary); -struct drm_framebuffer *fb = new_primary_state->fb;intel_fbc_post_update (crtc);@@ -5170,15 +5182,12 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state) (needs_modeset(&pipe_config->base) || !old_primary_state->visible))intel_post_enable_primary (&crtc->base, pipe_config); - -/* Display WA 827 */ -if ((INTEL_GEN (dev_priv) ==9 && !IS_GEMINILAKE (dev_priv)) || -IS_CANNONLAKE (dev_priv)) { -if (fb && fb->format->format ==DRM_FORMAT_NV12 ) -skl_wa_clkgate (dev_priv, crtc->pipe, false); - } - } + +/* Display WA 827 */ +if (needs_nv12_wa (dev_priv, old_crtc_state) && + !needs_nv12_wa (dev_priv, pipe_config)) +skl_wa_clkgate (dev_priv, crtc->pipe, false); } static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,@@ -5202,14 +5211,6 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,struct intel_plane_state *new_primary_state =intel_atomic_get_new_plane_state (old_intel_state,to_intel_plane (primary)); -struct drm_framebuffer *fb = new_primary_state->base.fb; - -/* Display WA 827 */ -if ((INTEL_GEN (dev_priv) ==9 && !IS_GEMINILAKE (dev_priv)) || -IS_CANNONLAKE (dev_priv)) { -if (fb && fb->format->format ==DRM_FORMAT_NV12 ) -skl_wa_clkgate (dev_priv, crtc->pipe, true); - }intel_fbc_pre_update (crtc, pipe_config, new_primary_state);/*
drivers/gpu/drm/i915/intel_display.c static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state, · line 5228
Quoted 7 lines
drivers/gpu/drm/i915/intel_display.c +4
-0@@ -5221,6 +5222,11 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,intel_set_cpu_fifo_underrun_reporting (dev_priv, crtc->pipe, false); } +/* Display WA 827 */ +if (!needs_nv12_wa (dev_priv, old_crtc_state) && +needs_nv12_wa (dev_priv, pipe_config)) +skl_wa_clkgate (dev_priv, crtc->pipe, true);
That function name is pretty non-descriptive. What w/a? Oh, and the implementation looks somewhat bogus as well. It's using rmw for disable, but no rmw for enable. Someone may want to fix that up a bit as well.
This patch lgtm
Quoted 18 lines
drivers/gpu/drm/i915/intel_display.c +1
-0+/* * Vblank time updates from the shadow to live plane control register * are blocked if the memory self-refresh mode is active at that drivers/gpu/drm/i915/intel_drv.h +1
-0@@ -882,6 +882,7 @@ struct intel_crtc_state {/* bitmask of visible planes (enum plane_id) */ u8 active_planes; +u8 nv12_planes;/* HDMI scrambling status */ bool hdmi_scrambling;Signature · 1 line
2.16.3
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.CHECKPATCH: warning for drm/i915: Enable display workaround 827 for all planes, v2.
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: drm/i915: Enable display workaround 827 for all planes, v2.
URL : https://patchwork.freedesktop.org/series/41371/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip b8f0788dfd3f drm/i915: Enable display workaround 827 for all planes, v2. -:58: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #58: FILE: drivers/gpu/drm/i915/intel_display.c:5148: + if ((INTEL_GEN(dev_priv) == 9 && !IS_GEMINILAKE(dev_priv)) || + IS_CANNONLAKE(dev_priv))
total: 0 errors, 0 warnings, 1 checks, 95 lines checked
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for drm/i915: Enable display workaround 827 for all planes, v2.
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: drm/i915: Enable display workaround 827 for all planes, v2.
URL : https://patchwork.freedesktop.org/series/41371/
State : success
== Summary ==
Series 41371v1 drm/i915: Enable display workaround 827 for all planes, v2.
https://patchwork.freedesktop.org/api/1.0/series/41371/revisions/1/mbox/
---- Possible new issues:
Test gem_exec_gttfill:
Subgroup basic:
skip -> PASS (fi-pnv-d510)---- Known issues:
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-a:
pass -> FAIL (fi-skl-guc) fdo#103191fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fi-bdw-5557u total:285 pass:264 dwarn:0 dfail:0 fail:0 skip:21 time:432s fi-bdw-gvtdvm total:285 pass:261 dwarn:0 dfail:0 fail:0 skip:24 time:442s fi-blb-e6850 total:285 pass:220 dwarn:1 dfail:0 fail:0 skip:64 time:382s fi-bsw-n3050 total:285 pass:239 dwarn:0 dfail:0 fail:0 skip:46 time:544s fi-bwr-2160 total:285 pass:180 dwarn:0 dfail:0 fail:0 skip:105 time:299s fi-bxt-dsi total:285 pass:255 dwarn:0 dfail:0 fail:0 skip:30 time:514s fi-bxt-j4205 total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:514s fi-byt-j1900 total:285 pass:250 dwarn:0 dfail:0 fail:0 skip:35 time:523s fi-byt-n2820 total:285 pass:246 dwarn:0 dfail:0 fail:0 skip:39 time:508s fi-cfl-8700k total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:409s fi-cfl-s3 total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:560s fi-cfl-u total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:514s fi-cnl-y3 total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:590s fi-elk-e7500 total:285 pass:226 dwarn:0 dfail:0 fail:0 skip:59 time:424s fi-gdg-551 total:285 pass:176 dwarn:0 dfail:0 fail:1 skip:108 time:314s fi-glk-1 total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:546s fi-glk-j4005 total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:485s fi-hsw-4770 total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:411s fi-ilk-650 total:285 pass:225 dwarn:0 dfail:0 fail:0 skip:60 time:425s fi-ivb-3520m total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:473s fi-ivb-3770 total:285 pass:252 dwarn:0 dfail:0 fail:0 skip:33 time:437s fi-kbl-7500u total:285 pass:260 dwarn:1 dfail:0 fail:0 skip:24 time:471s fi-kbl-7567u total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:468s fi-kbl-r total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:511s fi-pnv-d510 total:285 pass:220 dwarn:1 dfail:0 fail:0 skip:64 time:668s fi-skl-6260u total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:439s fi-skl-6600u total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:536s fi-skl-6700k2 total:285 pass:261 dwarn:0 dfail:0 fail:0 skip:24 time:499s fi-skl-6770hq total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:509s fi-skl-guc total:285 pass:256 dwarn:0 dfail:0 fail:1 skip:28 time:430s fi-skl-gvtdvm total:285 pass:262 dwarn:0 dfail:0 fail:0 skip:23 time:446s fi-snb-2520m total:285 pass:245 dwarn:0 dfail:0 fail:0 skip:40 time:572s fi-snb-2600 total:285 pass:245 dwarn:0 dfail:0 fail:0 skip:40 time:396s
1cda370ffded69ce8c5ffa4fba3564a952730b97 drm-tip: 2018y-04m-09d-14h-03m-58s UTC integration manifest b8f0788dfd3f drm/i915: Enable display workaround 827 for all planes, v2.
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8644/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for drm/i915: Enable display workaround 827 for all planes, v2.
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: drm/i915: Enable display workaround 827 for all planes, v2.
URL : https://patchwork.freedesktop.org/series/41371/
State : success
== Summary ==
---- Known issues:
Test kms_flip:
Subgroup 2x-flip-vs-expired-vblank-interruptible:
fail -> PASS (shard-hsw) fdo#102887
Subgroup dpms-vs-vblank-race:
pass -> FAIL (shard-hsw) fdo#103060
Test kms_sysfs_edid_timing:
warn -> PASS (shard-apl) fdo#100047
Test perf:
Subgroup polling:
pass -> INCOMPLETE (shard-hsw) fdo#102252fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
shard-apl total:2680 pass:1836 dwarn:1 dfail:0 fail:7 skip:836 time:12684s shard-hsw total:2679 pass:1783 dwarn:1 dfail:0 fail:2 skip:891 time:10954s Blacklisted hosts: shard-kbl total:2680 pass:1960 dwarn:1 dfail:0 fail:9 skip:710 time:9209s shard-snb total:2680 pass:1377 dwarn:1 dfail:0 fail:3 skip:1299 time:6953s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8644/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx