drm/i915: Balance prepare_fb/cleanup_fb
Subsystems (2)
PATCH 1/2 drm/i915: Balance prepare_fb/cleanup_fb
From: Ville Syrjälä <[email protected]>
intel_prepare_plane_fb() bails early if there is no fb (or rather no obj, which is the same thing). intel_cleanup_plane_fb() does not. This means the steps performed by intel_cleanup_plane_fb() aren't balanced with with what was done intel_prepare_plane_fb() if there is no fb for the plane. These hooks get called for every plane in the state regardless of whether they have an fb or not.
Add a matching null obj check to intel_cleanup_plane_fb() to restore the balance.
Note that intel_cleanup_plane_fb() has sufficient protections already in place that the imbalance doesn't cause any real problems. But having things be in balance seems nicer anyway, and might help avoid some surprises in the future.
--- drivers/gpu/drm/i915/intel_display.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/intel_display.c +4 -0
@@ -13231,6 +13231,10 @@ intel_cleanup_plane_fb(struct drm_plane *plane,struct intel_atomic_state *intel_state =to_intel_atomic_state (old_state->state);struct drm_i915_private *dev_priv =to_i915 (plane->dev); +struct drm_i915_gem_object *obj =intel_fb_obj (old_state->fb); + +if (!obj) +return ;if (intel_state->rps_interactive) {intel_rps_mark_interactive (dev_priv, false);
Signature · 6 lines
2.16.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/2 drm/i915: Cleanup properly if the implicit fence wait fails
From: Ville Syrjälä <[email protected]>
We've already pinned the vma and fence by the time we try to deal with implicit fencing. Properly unpin the vma and fence if the fence wait fails instead of just bailing straight out from .prepare_fb(). As can be expected drm_atomic_helper_prepare_planes() will not call .cleanup_fb() for the plane whose .prepare_fb() failed so we must do the cleanup ourself.
--- drivers/gpu/drm/i915/intel_display.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +8 -1
@@ -13188,7 +13188,7 @@ intel_prepare_plane_fb(struct drm_plane *plane, false,I915_FENCE_TIMEOUT , GFP_KERNEL);if (ret <0 ) -return ret; + goto unpin_fb; fence =reservation_object_get_excl_rcu (obj->resv);if (fence) {
@@ -13213,6 +13213,13 @@ intel_prepare_plane_fb(struct drm_plane *plane, }return 0 ; + +unpin_fb: +mutex_lock (&dev_priv->drm.struct_mutex); +intel_plane_unpin_fb (to_intel_plane_state (new_state)); +mutex_unlock (&dev_priv->drm.struct_mutex); + +return ret; }/**
Signature · 6 lines
2.16.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Balance prepare_fb/cleanup_fb
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: series starting with [1/2] drm/i915: Balance prepare_fb/cleanup_fb
URL : https://patchwork.freedesktop.org/series/49579/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4813 -> Patchwork_10162 =
== Summary - SUCCESS ==
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/49579/revisions/1/mbox/
== Known issues ==
Here are the changes found in Patchwork_10162 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@drv_selftest@live_coherency:
fi-gdg-551: PASS -> DMESG-FAIL (fdo#107164)
igt@kms_frontbuffer_tracking@basic:
fi-hsw-peppy: PASS -> DMESG-WARN (fdo#102614)
igt@kms_pipe_crc_basic@read-crc-pipe-b-frame-sequence:
fi-byt-clapper: PASS -> FAIL (fdo#107362, fdo#103191)
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
fi-bdw-samus: PASS -> INCOMPLETE (fdo#107773)
==== Possible fixes ====
igt@drv_selftest@live_hangcheck:
fi-cfl-guc: DMESG-FAIL (fdo#107710) -> PASS
igt@gem_exec_suspend@basic-s4-devices:
fi-kbl-7500u: DMESG-WARN (fdo#105128, fdo#107139) -> PASS
igt@kms_frontbuffer_tracking@basic:
fi-byt-clapper: FAIL (fdo#103167) -> PASS
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
fi-bxt-dsi: INCOMPLETE (fdo#103927) -> PASS fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fdo#105128 https://bugs.freedesktop.org/show_bug.cgi?id=105128
fdo#107139 https://bugs.freedesktop.org/show_bug.cgi?id=107139
fdo#107164 https://bugs.freedesktop.org/show_bug.cgi?id=107164
fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
fdo#107710 https://bugs.freedesktop.org/show_bug.cgi?id=107710
fdo#107773 https://bugs.freedesktop.org/show_bug.cgi?id=107773
== Participating hosts (51 -> 46) ==
Missing (5): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-hsw-4200u
== Build changes ==
* Linux: CI_DRM_4813 -> Patchwork_10162
CI_DRM_4813: 3c13515b12339366b414637b69227a4e3cbe21ae @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4640: 9a8da36e708f9ed15b20689dfe305e41f9a19008 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10162: 1cd88e7b6658c837ba56720021f228850b390719 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
1cd88e7b6658 drm/i915: Cleanup properly if the implicit fence wait fails c1782795d8bd drm/i915: Balance prepare_fb/cleanup_fb
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10162/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for series starting with [1/2] drm/i915: Balance prepare_fb/cleanup_fb
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: series starting with [1/2] drm/i915: Balance prepare_fb/cleanup_fb
URL : https://patchwork.freedesktop.org/series/49579/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4813_full -> Patchwork_10162_full =
== Summary - SUCCESS ==
No regressions found.
== Known issues ==
Here are the changes found in Patchwork_10162_full that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@kms_flip@flip-vs-expired-vblank-interruptible:
shard-glk: PASS -> FAIL (fdo#105363, fdo#102887)
==== Possible fixes ====
igt@gem_exec_await@wide-contexts:
shard-glk: FAIL (fdo#106680) -> PASS fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
fdo#106680 https://bugs.freedesktop.org/show_bug.cgi?id=106680
== Participating hosts (5 -> 5) ==
No changes in participating hosts
== Build changes ==
* Linux: CI_DRM_4813 -> Patchwork_10162
CI_DRM_4813: 3c13515b12339366b414637b69227a4e3cbe21ae @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4640: 9a8da36e708f9ed15b20689dfe305e41f9a19008 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10162: 1cd88e7b6658c837ba56720021f228850b390719 @ 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_10162/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx