From patchwork Mon Nov 12 17:32:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ville Syrjala X-Patchwork-Id: 1729471 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 5F0B3DFE80 for ; Mon, 12 Nov 2012 17:45:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 45E7B9F365 for ; Mon, 12 Nov 2012 09:45:20 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 94A3E9F0F3 for ; Mon, 12 Nov 2012 09:33:44 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 12 Nov 2012 09:33:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,764,1344236400"; d="scan'208";a="245675696" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.168]) by fmsmga001.fm.intel.com with SMTP; 12 Nov 2012 09:33:42 -0800 Received: by stinkbox (sSMTP sendmail emulation); Mon, 12 Nov 2012 19:33:41 +0200 From: ville.syrjala@linux.intel.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 12/22] drm/i915: Kill the pending_flip counter manipulations Date: Mon, 12 Nov 2012 19:32:50 +0200 Message-Id: <1352741580-12141-13-git-send-email-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1352741580-12141-1-git-send-email-ville.syrjala@linux.intel.com> References: <1352741580-12141-1-git-send-email-ville.syrjala@linux.intel.com> MIME-Version: 1.0 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);