From patchwork Fri Apr 27 06:17:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10367487 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 8BEBA602B3 for ; Fri, 27 Apr 2018 06:18:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B2DE28458 for ; Fri, 27 Apr 2018 06:18:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 700D829301; Fri, 27 Apr 2018 06:18:07 +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=-5.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,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 E3E1D28458 for ; Fri, 27 Apr 2018 06:18:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6BD7A6E7F2; Fri, 27 Apr 2018 06:17:53 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id C57C06E7E7 for ; Fri, 27 Apr 2018 06:17:45 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id t11so716854wmt.0 for ; Thu, 26 Apr 2018 23:17:45 -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 :mime-version:content-transfer-encoding; bh=T+wKh49wmR2qz5SUrYzs57uFK4W8704TVx1lexyTt7o=; b=O2uKmZSZM40ZTJp1rRHyYVUqVtbHMfcZE7jZ3Wri3hyTMFA46FDKQvsFSuxl1IBelx 8xGbSxA1GX+x5JMdfP44jEF4stdkDv3JWr5fX+q+leeP0RvvDuE89SBg3jE0yeQwV2IK KoZXAoSA4mCyNR5Zrv6A6DvEf6aLyIA8YN6cE= 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:mime-version:content-transfer-encoding; bh=T+wKh49wmR2qz5SUrYzs57uFK4W8704TVx1lexyTt7o=; b=i4RMmCn0PxVXr3XAX427iSs8ip/RsQr4AQaz6W2GkJ07bCU4HPicO/DY/JAPZLTpNg 5BHXOEx/5aAhu2KZFI/upZmhho9citq+AOUWZ90rMW2ouAMGTB8ITK0ZeCH/Ss2F0E3Q zrAlw4XolqkTdfgOLENJ5/ErKOs58dXP8EoUeA3U5LGBZkVX5QGpNdj1MQEZIa7qPlE1 PeCH+2VChMaz+MJL704JxZW/HG3lPBTNcedGZnB2tW/MSObmP5Iafe3O70pZU2/JPd3V vFvHrhqwsX4jaiIcRFt7dPShDh/d/VdOx/y937ZZ/W0l0grE3ltVMGDyx+YNfkl/LkGE vHkA== X-Gm-Message-State: ALQs6tAs/+HzwGLqb97mV8alSg0ZfiuLVg+PN8F58v3Ijl+fczf+JixZ GMQNGzZs8YDg+1ouQe9EgLBuCA== X-Google-Smtp-Source: AB8JxZp438K3+he/Vif2FwJnEf2xOHDAB8Aao4PrrSwTh8XZv/0/bEg8EpJe8+68c1vS/es/00hgrg== X-Received: by 2002:a50:bf4f:: with SMTP id g15-v6mr340336edk.283.1524809864424; Thu, 26 Apr 2018 23:17:44 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:5635:0:39d2:f87e:2033:9f6]) by smtp.gmail.com with ESMTPSA id r15-v6sm468897edq.40.2018.04.26.23.17.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Apr 2018 23:17:43 -0700 (PDT) From: Daniel Vetter To: DRI Development Date: Fri, 27 Apr 2018 08:17:20 +0200 Message-Id: <20180427061724.28497-14-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427061724.28497-1-daniel.vetter@ffwll.ch> References: <20180427061724.28497-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 13/17] drm/radeon: Remove custom dma_fence_ops->wait implementation X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "David \(ChunMing\) Zhou" , Daniel Vetter , Intel Graphics Development , amd-gfx@lists.freedesktop.org, Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP It's a copy of dma_fence_default_wait, written slightly differently. Signed-off-by: Daniel Vetter Cc: Alex Deucher Cc: "Christian König" Cc: "David (ChunMing) Zhou" Cc: amd-gfx@lists.freedesktop.org --- drivers/gpu/drm/radeon/radeon_fence.c | 63 --------------------------- 1 file changed, 63 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c index e86f2bd38410..32690a525bfc 100644 --- a/drivers/gpu/drm/radeon/radeon_fence.c +++ b/drivers/gpu/drm/radeon/radeon_fence.c @@ -1051,72 +1051,9 @@ static const char *radeon_fence_get_timeline_name(struct dma_fence *f) } } -static inline bool radeon_test_signaled(struct radeon_fence *fence) -{ - return test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->base.flags); -} - -struct radeon_wait_cb { - struct dma_fence_cb base; - struct task_struct *task; -}; - -static void -radeon_fence_wait_cb(struct dma_fence *fence, struct dma_fence_cb *cb) -{ - struct radeon_wait_cb *wait = - container_of(cb, struct radeon_wait_cb, base); - - wake_up_process(wait->task); -} - -static signed long radeon_fence_default_wait(struct dma_fence *f, bool intr, - signed long t) -{ - struct radeon_fence *fence = to_radeon_fence(f); - struct radeon_device *rdev = fence->rdev; - struct radeon_wait_cb cb; - - cb.task = current; - - if (dma_fence_add_callback(f, &cb.base, radeon_fence_wait_cb)) - return t; - - while (t > 0) { - if (intr) - set_current_state(TASK_INTERRUPTIBLE); - else - set_current_state(TASK_UNINTERRUPTIBLE); - - /* - * radeon_test_signaled must be called after - * set_current_state to prevent a race with wake_up_process - */ - if (radeon_test_signaled(fence)) - break; - - if (rdev->needs_reset) { - t = -EDEADLK; - break; - } - - t = schedule_timeout(t); - - if (t > 0 && intr && signal_pending(current)) - t = -ERESTARTSYS; - } - - __set_current_state(TASK_RUNNING); - dma_fence_remove_callback(f, &cb.base); - - return t; -} - const struct dma_fence_ops radeon_fence_ops = { .get_driver_name = radeon_fence_get_driver_name, .get_timeline_name = radeon_fence_get_timeline_name, .enable_signaling = radeon_fence_enable_signaling, .signaled = radeon_fence_is_signaled, - .wait = radeon_fence_default_wait, - .release = NULL, };