From patchwork Wed Dec 12 16:16:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 1869051 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 1B3363FC81 for ; Wed, 12 Dec 2012 17:38:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1D22CE6557 for ; Wed, 12 Dec 2012 09:38:57 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id C3681E5C97; Wed, 12 Dec 2012 08:20:06 -0800 (PST) Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga101.ch.intel.com with ESMTP; 12 Dec 2012 08:20:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,267,1355126400"; d="scan'208";a="179978150" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.168]) by AZSMGA002.ch.intel.com with SMTP; 12 Dec 2012 08:20:03 -0800 Received: by stinkbox (sSMTP sendmail emulation); Wed, 12 Dec 2012 18:20:03 +0200 From: ville.syrjala@linux.intel.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 54/81] drm/i915: Kill the pending_flip counter manipulations Date: Wed, 12 Dec 2012 18:16:21 +0200 Message-Id: <1355329008-31459-55-git-send-email-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1355329008-31459-1-git-send-email-ville.syrjala@linux.intel.com> References: <1355329008-31459-1-git-send-email-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Cc: intel-gfx@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Ville Syrjälä The pending_flip counter is probably going to be remove entirely, along with i915_gem_execbuffer_wait_for_flips() so don't even try to use it. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_atomic.c | 74 +---------------------------------- 1 files changed, 2 insertions(+), 72 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c index 1fce359..ac7fe88 100644 --- a/drivers/gpu/drm/i915/intel_atomic.c +++ b/drivers/gpu/drm/i915/intel_atomic.c @@ -1536,45 +1536,9 @@ static void atomic_pipe_commit(struct drm_device *dev, struct intel_atomic_state *state, int pipe); -static int apply_nonblocking(struct drm_device *dev, struct intel_atomic_state *s) +static void apply_nonblocking(struct drm_device *dev, struct intel_atomic_state *s) { struct intel_crtc *intel_crtc; - int i; - - for (i = 0; i < dev->mode_config.num_crtc; i++) { - struct intel_crtc_state *st = &s->crtc[i]; - struct intel_crtc *intel_crtc = to_intel_crtc(st->crtc); - struct drm_i915_gem_object *obj; - - if (!st->old.fb) - continue; - - obj = to_intel_framebuffer(st->old.fb)->obj; - - /* Only one bit per plane in pending_flips */ - if (atomic_read(&obj->pending_flip) & (1 << intel_crtc->plane)) - return -EBUSY; - } - - for (i = 0; i < dev->mode_config.num_plane; i++) { - struct intel_plane_state *st = &s->plane[i]; - struct intel_plane *intel_plane = to_intel_plane(st->plane); - struct drm_i915_gem_object *obj; - - if (!st->old.fb) - continue; - - obj = to_intel_framebuffer(st->old.fb)->obj; - - if (!st->old.fb) - continue; - - obj = to_intel_framebuffer(st->old.fb)->obj; - - /* Only one bit per plane in pending_flips */ - if (atomic_read(&obj->pending_flip) & (1 << (16 + intel_plane->pipe))) - return -EBUSY; - } list_for_each_entry(intel_crtc, &dev->mode_config.crtc_list, base.head) atomic_pipe_commit(dev, s, intel_crtc->pipe); @@ -1582,8 +1546,6 @@ static int apply_nonblocking(struct drm_device *dev, struct intel_atomic_state * /* don't restore the old state in end() */ s->dirty = false; s->restore_state = false; - - return 0; } static int alloc_flip_data(struct drm_device *dev, struct intel_atomic_state *s) @@ -1695,12 +1657,7 @@ static int intel_atomic_commit(struct drm_device *dev, void *state) /* try to apply in a non blocking manner */ if (s->flags & DRM_MODE_ATOMIC_NONBLOCK) { - ret = apply_nonblocking(dev, s); - if (ret) { - unpin_cursors(dev, s); - unpin_fbs(dev, s); - return ret; - } + apply_nonblocking(dev, s); } else { /* apply in a blocking manner */ ret = apply_config(dev, s); @@ -1823,7 +1780,6 @@ static void intel_flip_complete(struct drm_flip *flip) struct intel_flip *intel_flip = container_of(flip, struct intel_flip, base); struct drm_device *dev = intel_flip->crtc->dev; - struct drm_i915_private *dev_priv = dev->dev_private; struct drm_crtc *crtc = intel_flip->crtc; struct intel_crtc *intel_crtc = to_intel_crtc(crtc); int pipe = intel_crtc->pipe; @@ -1841,18 +1797,6 @@ static void intel_flip_complete(struct drm_flip *flip) if (intel_flip->vblank_ref) drm_vblank_put(dev, pipe); - - /* Possibly allow rendering to old_bo again */ - if (intel_flip->old_bo) { - if (intel_flip->plane) { - struct intel_plane *intel_plane = to_intel_plane(intel_flip->plane); - atomic_clear_mask(1 << (16 + intel_plane->pipe), &intel_flip->old_bo->pending_flip.counter); - } else - atomic_clear_mask(1 << intel_crtc->plane, &intel_flip->old_bo->pending_flip.counter); - - if (atomic_read(&intel_flip->old_bo->pending_flip) == 0) - wake_up(&dev_priv->pending_flip_queue); - } } static void intel_flip_finish(struct drm_flip *flip) @@ -2193,13 +2137,6 @@ static void atomic_pipe_commit(struct drm_device *dev, mutex_lock(&dev->struct_mutex); drm_gem_object_reference(&intel_flip->old_bo->base); mutex_unlock(&dev->struct_mutex); - - /* - * Block clients from rendering to the new back buffer until - * the flip occurs and the object is no longer visible. - */ - atomic_set_mask(1 << intel_crtc->plane, - &intel_flip->old_bo->pending_flip.counter); } list_add_tail(&intel_flip->base.list, &flips); @@ -2244,13 +2181,6 @@ static void atomic_pipe_commit(struct drm_device *dev, mutex_lock(&dev->struct_mutex); drm_gem_object_reference(&intel_flip->old_bo->base); mutex_unlock(&dev->struct_mutex); - - /* - * Block clients from rendering to the new back buffer until - * the flip occurs and the object is no longer visible. - */ - atomic_set_mask(1 << (16 + intel_plane->pipe), - &intel_flip->old_bo->pending_flip.counter); } list_add_tail(&intel_flip->base.list, &flips);