From patchwork Thu Oct 22 11:56:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 7464541 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 F2AC69F302 for ; Thu, 22 Oct 2015 11:56:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E4FD620941 for ; Thu, 22 Oct 2015 11:56:51 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A9BBD20948 for ; Thu, 22 Oct 2015 11:56:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 38D2A6E45D; Thu, 22 Oct 2015 04:56:49 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mblankhorst.nl (mblankhorst.nl [141.105.120.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id D6B786E3F6 for ; Thu, 22 Oct 2015 04:56:42 -0700 (PDT) From: Maarten Lankhorst To: intel-gfx@lists.freedesktop.org Date: Thu, 22 Oct 2015 13:56:33 +0200 Message-Id: <1445514996-18733-9-git-send-email-maarten.lankhorst@linux.intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1445514996-18733-1-git-send-email-maarten.lankhorst@linux.intel.com> References: <1445514996-18733-1-git-send-email-maarten.lankhorst@linux.intel.com> Subject: [Intel-gfx] [PATCH 08/11] drm/i915: Nuke fbc members from intel_crtc->atomic. 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 This leaves intel_crtc->atomic empty, so zap it as well. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/intel_display.c | 63 +++++++++++++----------------------- drivers/gpu/drm/i915/intel_drv.h | 16 --------- 2 files changed, 23 insertions(+), 56 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 1cd79d9b3da1..6f92ccf2461c 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -4749,7 +4749,6 @@ 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); struct drm_atomic_state *old_state = old_crtc_state->base.state; - struct intel_crtc_atomic_commit *atomic = &crtc->atomic; struct intel_crtc_state *pipe_config = to_intel_crtc_state(crtc->base.state); struct drm_device *dev = crtc->base.dev; @@ -4765,9 +4764,6 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state) if (pipe_config->wm_changed) intel_update_watermarks(&crtc->base); - if (atomic->update_fbc) - intel_fbc_update(dev_priv); - for_each_plane_in_state(old_state, plane, old_plane_state, i) { struct intel_plane_state *plane_state = to_intel_plane_state(plane->state); @@ -4782,6 +4778,9 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state) (needs_modeset(&pipe_config->base) || !to_intel_plane_state(old_plane_state)->visible)) intel_post_enable_primary(&crtc->base); + + if (plane_state->visible) + intel_fbc_update(dev_priv); break; case DRM_PLANE_TYPE_CURSOR: @@ -4796,8 +4795,6 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state) break; } } - - memset(atomic, 0, sizeof(*atomic)); } static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state) @@ -4805,7 +4802,6 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state) struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->base.crtc); struct drm_device *dev = crtc->base.dev; struct drm_i915_private *dev_priv = dev->dev_private; - struct intel_crtc_atomic_commit *atomic = &crtc->atomic; struct intel_crtc_state *pipe_config = to_intel_crtc_state(crtc->base.state); struct drm_atomic_state *old_state = old_crtc_state->base.state; @@ -4814,9 +4810,6 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state) drm_atomic_get_existing_plane_state(old_state, primary); bool modeset = needs_modeset(&pipe_config->base); - if (atomic->disable_fbc) - intel_fbc_disable_crtc(crtc); - if (old_pri_state) { struct intel_plane_state *primary_state = to_intel_plane_state(primary->state); @@ -4824,8 +4817,27 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state) to_intel_plane_state(old_pri_state); if (old_primary_state->visible && - (modeset || !primary_state->visible)) + (modeset || !primary_state->visible)) { + intel_fbc_disable_crtc(crtc); + intel_pre_disable_primary(&crtc->base); + } else if (primary_state->visible && + INTEL_INFO(dev_priv)->gen <= 4 && !IS_G4X(dev_priv) && + dev_priv->fbc.crtc == crtc && + primary_state->base.rotation != BIT(DRM_ROTATE_0)) { + /* + * FBC does not work on some platforms for rotated + * planes, so disable it when rotation is not 0 and + * update it when rotation is set back to 0. + * + * FIXME: This is redundant with the fbc update done in + * the primary plane enable function except that that + * one is done too late. We eventually need to unify + * this. + */ + + intel_fbc_disable_crtc(crtc); + } } if (pipe_config->visible_changed) { @@ -11645,7 +11657,6 @@ int intel_plane_atomic_calc_changes(struct drm_crtc_state *crtc_state, struct intel_crtc *intel_crtc = to_intel_crtc(crtc); struct drm_plane *plane = plane_state->plane; struct drm_device *dev = crtc->dev; - struct drm_i915_private *dev_priv = dev->dev_private; struct intel_plane_state *old_plane_state = to_intel_plane_state(plane->state); int idx = intel_crtc->base.base.id, ret; @@ -11701,34 +11712,6 @@ int intel_plane_atomic_calc_changes(struct drm_crtc_state *crtc_state, if (visible || was_visible) pipe_config->fb_bits |= to_intel_plane(plane)->frontbuffer_bit; - switch (plane->type) { - case DRM_PLANE_TYPE_PRIMARY: - if (turn_off) - intel_crtc->atomic.disable_fbc = true; - - /* - * FBC does not work on some platforms for rotated - * planes, so disable it when rotation is not 0 and - * update it when rotation is set back to 0. - * - * FIXME: This is redundant with the fbc update done in - * the primary plane enable function except that that - * one is done too late. We eventually need to unify - * this. - */ - - if (visible && - INTEL_INFO(dev)->gen <= 4 && !IS_G4X(dev) && - dev_priv->fbc.crtc == intel_crtc && - plane_state->rotation != BIT(DRM_ROTATE_0)) - intel_crtc->atomic.disable_fbc = true; - - intel_crtc->atomic.update_fbc |= visible || mode_changed; - break; - case DRM_PLANE_TYPE_CURSOR: - case DRM_PLANE_TYPE_OVERLAY: - break; - } return 0; } diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 75cfd8c7b981..40011f637980 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -509,20 +509,6 @@ struct skl_pipe_wm { uint32_t linetime; }; -/* - * Tracking of operations that need to be performed at the beginning/end of an - * atomic commit, outside the atomic section where interrupts are disabled. - * These are generally operations that grab mutexes or might otherwise sleep - * and thus can't be run with interrupts disabled. - */ -struct intel_crtc_atomic_commit { - /* Sleepable operations to perform before commit */ - bool disable_fbc; - - /* Sleepable operations to perform after commit */ - bool update_fbc; -}; - struct intel_crtc { struct drm_crtc base; enum pipe pipe; @@ -590,8 +576,6 @@ struct intel_crtc { int scanline_start; } debug; - struct intel_crtc_atomic_commit atomic; - /* scalers available on this crtc */ int num_scalers;