From patchwork Fri Jul 31 22:22:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 6920991 Return-Path: X-Original-To: patchwork-dri-devel@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 8BE399F38B for ; Fri, 31 Jul 2015 22:23:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C654320653 for ; Fri, 31 Jul 2015 22:23:45 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DED6620631 for ; Fri, 31 Jul 2015 22:23:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BBB177A21F; Fri, 31 Jul 2015 15:23:43 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yk0-f171.google.com (mail-yk0-f171.google.com [209.85.160.171]) by gabe.freedesktop.org (Postfix) with ESMTPS id 89DCD6EDFD for ; Fri, 31 Jul 2015 15:23:03 -0700 (PDT) Received: by ykay190 with SMTP id y190so70353027yka.3 for ; Fri, 31 Jul 2015 15:23:02 -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=/NY8xjkIzpNW7VSS6g2Y6ZHCJ48cWKSmDzCCdSOOmEQ=; b=l+VimQALUOhrqocwRoRBzwoQxdY0BDD0TmjLni3VhOlugv9K5dW2XsfLFGB4oX9QSP e5/9Zs5cNVLDIOnvBQ6dbSdZuTN/mM80TYl3VCf8Ty+VuWKrPiqr/3MxsIxdtcOwnB/R 0ZBTM4Rz/ZvCQrDzYrrYmMptKsIHDlXozc72wbhcL1+D34vmiCqP2N/ZYd1XS4w1wciU 10+VYqxppSOq+qlI3ATZl+hKhnPnmjw0uqhDR2JB1XIW5eof0hNcbcl2/HU6TD2op4Wi 8Bbyf2mCU3rF20mTXK5zTYICpDRcL12Wr5+24WcCb9Sn/yHXeTdU5/gW+Fzoz29Pd0Kj ziEw== X-Received: by 10.170.57.207 with SMTP id 198mr6332886ykz.118.1438381382863; Fri, 31 Jul 2015 15:23:02 -0700 (PDT) Received: from localhost.localdomain (static-74-96-105-49.washdc.fios.verizon.net. [74.96.105.49]) by smtp.gmail.com with ESMTPSA id u78sm5438990ywu.13.2015.07.31.15.23.02 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Jul 2015 15:23:02 -0700 (PDT) From: Alex Deucher X-Google-Original-From: Alex Deucher To: dri-devel@lists.freedesktop.org Subject: [PATCH 13/31] drm/amdgpu: add sched isr to fence process Date: Fri, 31 Jul 2015 18:22:29 -0400 Message-Id: <1438381367-24980-14-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1438381367-24980-1-git-send-email-alexander.deucher@amd.com> References: <1438381367-24980-1-git-send-email-alexander.deucher@amd.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.5 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: Chunming Zhou Signed-off-by: Chunming Zhou Reviewed-by: Jammy Zhou --- drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c index fdb3105..601f264 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c @@ -346,8 +346,24 @@ void amdgpu_fence_process(struct amdgpu_ring *ring) } } while (atomic64_xchg(&ring->fence_drv.last_seq, seq) > seq); - if (wake) + if (wake) { + if (amdgpu_enable_scheduler) { + uint64_t handled_seq = + amd_sched_get_handled_seq(ring->scheduler); + uint64_t latest_seq = + atomic64_read(&ring->fence_drv.last_seq); + if (handled_seq == latest_seq) { + DRM_ERROR("ring %d, EOP without seq update (lastest_seq=%llu)\n", + ring->idx, latest_seq); + return; + } + do { + amd_sched_isr(ring->scheduler); + } while (amd_sched_get_handled_seq(ring->scheduler) < latest_seq); + } + wake_up_all(&ring->adev->fence_queue); + } } /**