[Intel-gfx] [PATCH 1/4] drm/i915: Trim struct_mutex usage for kms
Maarten Lankhorst
maarten.lankhorst at linux.intel.com
Thu Jun 15 16:50:31 UTC 2017
Op 15-06-17 om 10:25 schreef Chris Wilson:
> Reduce acquisition of struct_mutex to the critical regions that must
> hold it; for KMS, we need struct_mutex currently only for the purpose of
> pinning/unpinning the framebuffer's VMA into the global GTT. This allows
> us to avoid taking the struct_mutex when disabling the CRTC (i.e. NULL
> framebuffer objects) before a reset. (Not yet achieving the full goal of
> avoiding the strut_mutex nesting, but good enough to break the first
> half of the reset deadlock.)
>
> v2: Keep pages pinning inside struct_mutex for the moment.
>
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_display.c | 80 ++++++++++++++++--------------------
> 1 file changed, 36 insertions(+), 44 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index f9bf0d508053..b254094c689c 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> <snip>
> - if (!obj && !old_obj)
> - return 0;
^This needs to be a bugfix commit on its own, since it harmonizes fence waiting with drm_atomic_helper_wait_for_fences.
> if (old_obj) {
> struct drm_crtc_state *crtc_state =
> drm_atomic_get_existing_crtc_state(new_state->state,
> @@ -13399,6 +13364,33 @@ intel_prepare_plane_fb(struct drm_plane *plane,
> if (!obj)
> return 0;
>
> + ret = mutex_lock_interruptible(&dev_priv->drm.struct_mutex);
> + if (ret) {
> + i915_gem_object_unpin_pages(obj);
Should be in patch 4?
Otherwise patches look ok. I can't comment on patch 3, but with comments fixed and assuming kms_cursor_legacy still works.. for patch 1, 2, 4:
Reviewed-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
More information about the Intel-gfx
mailing list