From patchwork Sat Jul 15 11:40:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 9842329 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0655A60212 for ; Sat, 15 Jul 2017 11:40:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA768286FB for ; Sat, 15 Jul 2017 11:40:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF70C2872B; Sat, 15 Jul 2017 11:40:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9F31D286FB for ; Sat, 15 Jul 2017 11:40:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7E58E6E905; Sat, 15 Jul 2017 11:40:29 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 830656E901 for ; Sat, 15 Jul 2017 11:40:27 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id p204so14990645wmg.1 for ; Sat, 15 Jul 2017 04:40:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=f6LlatTf7LkbDlGyWqhLMjOzYXu5IPWQJUyGX6YpYHQ=; b=L85s86/M6wKmX1GE09vFaybKs67GsvbQBQUOP0JVcjVbPD9rbAXAIC+0cX/LWrAbvg u8ojSyYUdzBO4vYvHrzO9m8WhEfohT1TidQpzullw4f6W/38koIpY/+HxBVvFFYmo5CJ gq4dwzsEv89Kd6RKmv2WQ2UH94nc0EKLYOMYc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=f6LlatTf7LkbDlGyWqhLMjOzYXu5IPWQJUyGX6YpYHQ=; b=uEpTFTqMSjqHDVF4MCNDiFfvJTYytuUsY0+1y/IVC0hmXGmrK1pbORCNKw88oHgPpO vdH4dM0VcXDCOhuyV2RCadrY39a+Txr11K3hXH3DIVyeTRNg0SuSo9ULdZFZAy8rEVxz 0Sz5qUkZxsvgJbIcnJTCfLRdssTTaBlbSZ/slivOS+I9k4OzPgFgQdt8WXxApGmY8W0+ iNDpk8nbp4hFLDtiO+nZViOvRcIImkD5fdR+KDEyP5nraePfAps1c1lb0pABkMi/Fbb6 emRnD51kwRsD77WFgnA/2QygEuncKVhRZFWjDGOSm2wmvsYDCNrRSTklaCH/+vNoZ2XU ShyQ== X-Gm-Message-State: AIVw112g3W3u9XZuttSkDGuYgYaMMrCCzJmUAeRKkHF7zHF1yY7MpOKe B/rH/49WRNp3CNFfWmU= X-Received: by 10.80.137.45 with SMTP id e42mr10059955ede.67.1500118825868; Sat, 15 Jul 2017 04:40:25 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:5640:0:960b:2678:e223:c1c6]) by smtp.gmail.com with ESMTPSA id c8sm5898449edc.13.2017.07.15.04.40.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Jul 2017 04:40:25 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Sat, 15 Jul 2017 13:40:05 +0200 Message-Id: <20170715114006.6380-7-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170715114006.6380-1-daniel.vetter@ffwll.ch> References: <20170715114006.6380-1-daniel.vetter@ffwll.ch> Cc: Daniel Vetter , Mika Kuoppala , Daniel Vetter Subject: [Intel-gfx] [PATCH 6/7] drm/i915: Push i915_sw_fence_wait into the nonblocking atomic commit 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-Virus-Scanned: ClamAV using ClamSMTP Blocking in a worker is ok, that's what the unbound_wq is for. And it unifies the paths between the blocking and nonblocking commit, giving me just one path where I have to implement the deadlock avoidance trickery in the next patch. Cc: Chris Wilson Cc: Mika Kuoppala Cc: Joonas Lahtinen Signed-off-by: Daniel Vetter --- drivers/gpu/drm/i915/intel_display.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index dd541fe71d0a..f2ceb908ee95 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -12390,6 +12390,8 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state) unsigned crtc_vblank_mask = 0; int i; + i915_sw_fence_wait(&intel_state->commit_ready); + drm_atomic_helper_wait_for_dependencies(state); if (intel_state->modeset) @@ -12557,10 +12559,7 @@ intel_atomic_commit_ready(struct i915_sw_fence *fence, switch (notify) { case FENCE_COMPLETE: - if (state->base.commit_work.func) - queue_work(system_unbound_wq, &state->base.commit_work); break; - case FENCE_FREE: { struct intel_atomic_helper *helper = @@ -12656,14 +12655,14 @@ static int intel_atomic_commit(struct drm_device *dev, } drm_atomic_state_get(state); - INIT_WORK(&state->commit_work, - nonblock ? intel_atomic_commit_work : NULL); + INIT_WORK(&state->commit_work, intel_atomic_commit_work); i915_sw_fence_commit(&intel_state->commit_ready); - if (!nonblock) { - i915_sw_fence_wait(&intel_state->commit_ready); + if (nonblock) + queue_work(system_unbound_wq, &state->commit_work); + else intel_atomic_commit_tail(state); - } + return 0; }