From patchwork Thu Jul 2 22:25:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 6712121 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A3AC19F2F0 for ; Thu, 2 Jul 2015 22:26:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B67E120760 for ; Thu, 2 Jul 2015 22:26:07 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C360E20747 for ; Thu, 2 Jul 2015 22:26:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3489A6ED01; Thu, 2 Jul 2015 15:26:06 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qk0-f175.google.com (mail-qk0-f175.google.com [209.85.220.175]) by gabe.freedesktop.org (Postfix) with ESMTPS id DD2F96ED0D for ; Thu, 2 Jul 2015 15:26:04 -0700 (PDT) Received: by qkeo142 with SMTP id o142so62242663qke.1 for ; Thu, 02 Jul 2015 15:26:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=if8V3kqfihVWyQUltbU151nBBPByNirC8Xy6OZOY0ms=; b=HKMfj2iQCR91JP+A8wlpM81AOLLvaP0nSj9gNtid4NdxQBHnmgEeJmyYJp9QgYESxL DuGUWZESCwDb7zWomhJgoJo4UMw94mQGpvM/FniBVyfQNXyIXjCc+hv1Toupwc18mh2/ U+QfXR/DNXUoXv/KRmhOETKn07K67l3c21A+HY/lowD0x2894k4YkvkLGzbG7zI37FYX A1saOenW4m+99IY7FP2+NMkcqwOr9GNSxS2ZS1l3P9qo/+w38HVbk8tw9k1qt9Q+BHhh gogVnP/wX3oeb+WP7+vbRxxOoX06Dvuf+OxmGUCS0qNMsOzsNKXyotADYuxyIV38pSgj BbyQ== X-Received: by 10.140.99.65 with SMTP id p59mr46414427qge.46.1435875964130; Thu, 02 Jul 2015 15:26:04 -0700 (PDT) Received: from localhost.localdomain (r130-pw-tresbarras.ibys.com.br. [189.76.1.243]) by mx.google.com with ESMTPSA id 60sm3463564qgy.11.2015.07.02.15.26.02 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 Jul 2015 15:26:03 -0700 (PDT) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Thu, 2 Jul 2015 19:25:13 -0300 Message-Id: <1435875914-11516-8-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1435875914-11516-1-git-send-email-przanoni@gmail.com> References: <1435875914-11516-1-git-send-email-przanoni@gmail.com> Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH 7/8] drm/i915: FBC doesn't need struct_mutex anymore X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Paulo Zanoni Everything is covered either by fbc.lock or mm.stolen_lock, and intel_fbc.c is already responsible for grabbing the appropriate locks when it needs them. Reviewed-by: Chris wilson Signed-off-by: Paulo Zanoni --- drivers/gpu/drm/i915/i915_debugfs.c | 4 ---- drivers/gpu/drm/i915/intel_display.c | 14 +++----------- drivers/gpu/drm/i915/intel_fbc.c | 2 -- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index b2f3919..98fd3c9 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -1660,9 +1660,7 @@ static int i915_fbc_fc_get(void *data, u64 *val) if (INTEL_INFO(dev)->gen < 7 || !HAS_FBC(dev)) return -ENODEV; - drm_modeset_lock_all(dev); *val = dev_priv->fbc.false_color; - drm_modeset_unlock_all(dev); return 0; } @@ -1676,7 +1674,6 @@ static int i915_fbc_fc_set(void *data, u64 val) if (INTEL_INFO(dev)->gen < 7 || !HAS_FBC(dev)) return -ENODEV; - drm_modeset_lock_all(dev); mutex_lock(&dev_priv->fbc.lock); reg = I915_READ(ILK_DPFC_CONTROL); @@ -1687,7 +1684,6 @@ static int i915_fbc_fc_set(void *data, u64 val) (reg & ~FBC_CTL_FALSE_COLOR)); mutex_unlock(&dev_priv->fbc.lock); - drm_modeset_unlock_all(dev); return 0; } diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 01d7cff..83d971c 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -4747,11 +4747,8 @@ static void intel_post_plane_update(struct intel_crtc *crtc) if (crtc->atomic.update_wm_post) intel_update_watermarks(&crtc->base); - if (atomic->update_fbc) { - mutex_lock(&dev->struct_mutex); + if (atomic->update_fbc) intel_fbc_update(dev); - mutex_unlock(&dev->struct_mutex); - } if (atomic->post_enable_primary) intel_post_enable_primary(&crtc->base); @@ -4783,11 +4780,8 @@ static void intel_pre_plane_update(struct intel_crtc *crtc) if (atomic->wait_for_flips) intel_crtc_wait_for_pending_flips(&crtc->base); - if (atomic->disable_fbc) { - mutex_lock(&dev->struct_mutex); + if (atomic->disable_fbc) intel_fbc_disable_crtc(crtc); - mutex_unlock(&dev->struct_mutex); - } if (crtc->atomic.disable_ips) hsw_disable_ips(crtc); @@ -11473,9 +11467,9 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, i915_gem_track_fb(intel_fb_obj(work->old_fb), obj, to_intel_plane(primary)->frontbuffer_bit); + mutex_unlock(&dev->struct_mutex); intel_fbc_disable(dev); - mutex_unlock(&dev->struct_mutex); intel_frontbuffer_flip_prepare(dev, to_intel_plane(primary)->frontbuffer_bit); @@ -15605,9 +15599,7 @@ void intel_modeset_cleanup(struct drm_device *dev) intel_unregister_dsm_handler(); - mutex_lock(&dev->struct_mutex); intel_fbc_disable(dev); - mutex_unlock(&dev->struct_mutex); /* flush any delayed tasks or pending work */ flush_scheduled_work(); diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c index a076c7a..cc9b7ef 100644 --- a/drivers/gpu/drm/i915/intel_fbc.c +++ b/drivers/gpu/drm/i915/intel_fbc.c @@ -335,7 +335,6 @@ static void intel_fbc_work_fn(struct work_struct *__work) struct drm_device *dev = work->crtc->dev; struct drm_i915_private *dev_priv = dev->dev_private; - mutex_lock(&dev->struct_mutex); mutex_lock(&dev_priv->fbc.lock); if (work == dev_priv->fbc.fbc_work) { /* Double check that we haven't switched fb without cancelling @@ -352,7 +351,6 @@ static void intel_fbc_work_fn(struct work_struct *__work) dev_priv->fbc.fbc_work = NULL; } mutex_unlock(&dev_priv->fbc.lock); - mutex_unlock(&dev->struct_mutex); kfree(work); }