From patchwork Mon May 11 09:11:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11540029 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9F0B414B4 for ; Mon, 11 May 2020 09:11:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7D6362075E for ; Mon, 11 May 2020 09:11:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="BFrWfief" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D6362075E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D71CC6E3FB; Mon, 11 May 2020 09:11:55 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5E00F89DA9 for ; Mon, 11 May 2020 09:11:54 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id g12so18273159wmh.3 for ; Mon, 11 May 2020 02:11:54 -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:mime-version :content-transfer-encoding; bh=kypGotJsMo32YHf8OUx+eQZgE4BXycYY0Yyrzee1xg4=; b=BFrWfiefay0G3axbOIvAU7cL37XL0viEFlie/9f9z/E/mFIyz7gZQoFRa+kNZK4LQx XBOAAjgo9eXYRtibV6b8JVgQXHu/raQFY9l+V/l90+qLnl7fWQMjeziBAPOHwuPSFxCx NRDFbLWUul18dgcd2jgUu1QFdBk9GP0ZhMwg8= 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:mime-version :content-transfer-encoding; bh=kypGotJsMo32YHf8OUx+eQZgE4BXycYY0Yyrzee1xg4=; b=ZUFCSzqIuigs7fWSgINGzfTTbmsf8HJ9vQz/oceVWjYVrPmhkGGk0/2I98XDBY/wts /d7sN33Rs237wuLKRlrLNiqTNI3H5UKOK0yTmnGseexpvVwJsp4jA6stFk1ZCK66Y98E gzCVnHzJUcBRjGfdWS6xpFVoXyyuteghYwhwpk0pseCQDrrMS0u4BMydSU4oaV1qQnWS LlRrrnoeFqd3y6MpjvFEa+e/BpC7yqRqa0CwDUqW2NBRV1Ytht/gsN19N5oEpAKVU19c sFPYs+Km7Ij5KBBThaw+b0SCSz+dLZzbOZy98rzwGIjR3aShIMTa9DrXO2rB91BxXYGz N71g== X-Gm-Message-State: AGi0PuboVAtS/7Uo0sGXtDplhvF+g8mdAnaJy2bGty+ZVcOAl5UgXETW cAPVS9t9MglXFi8IA9GJ1Q3UGQ== X-Google-Smtp-Source: APiQypJu6MhVzS21pUOPY5hvSgBf8+CIjEHG8jg44vuH9LazUaM1m9dy/ExDV8ceiF+NtEDozOxG/w== X-Received: by 2002:a1c:acc8:: with SMTP id v191mr24673393wme.128.1589188313116; Mon, 11 May 2020 02:11:53 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id t4sm17506299wri.54.2020.05.11.02.11.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2020 02:11:52 -0700 (PDT) From: Daniel Vetter To: LKML Date: Mon, 11 May 2020 11:11:40 +0200 Message-Id: <20200511091142.208787-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 1/3] drm/writeback: don't set fence->ops to default X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Daniel Vetter , Intel Graphics Development , Maxime Ripard , DRI Development , Thomas Zimmermann , Daniel Vetter Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" It's the default. Signed-off-by: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter --- drivers/gpu/drm/drm_writeback.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/drm_writeback.c b/drivers/gpu/drm/drm_writeback.c index 43d9e3bb3a94..dccf4504f1bb 100644 --- a/drivers/gpu/drm/drm_writeback.c +++ b/drivers/gpu/drm/drm_writeback.c @@ -108,7 +108,6 @@ static const struct dma_fence_ops drm_writeback_fence_ops = { .get_driver_name = drm_writeback_fence_get_driver_name, .get_timeline_name = drm_writeback_fence_get_timeline_name, .enable_signaling = drm_writeback_fence_enable_signaling, - .wait = dma_fence_default_wait, }; static int create_writeback_properties(struct drm_device *dev) From patchwork Mon May 11 09:11:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11540031 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A708E14B4 for ; Mon, 11 May 2020 09:11:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8512B2075E for ; Mon, 11 May 2020 09:11:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="XSlecak9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8512B2075E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7254589E0C; Mon, 11 May 2020 09:11:57 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id 86BFD89EAE for ; Mon, 11 May 2020 09:11:55 +0000 (UTC) Received: by mail-wr1-x441.google.com with SMTP id k1so9944619wrx.4 for ; Mon, 11 May 2020 02:11:55 -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=Q7OJr2fNjgGIcJIqqF9ej5dw8+vyB2iSNpGREcUJdJ8=; b=XSlecak9WF0+12diZ+csclqCd6URlr2zAoK8NqOOevNyeI615JACkJ6RVjZvHhQMm/ cZGgYTHh6V8wa/pbt1dwPjKLdID/v2MfGPl4KhtWRCcVKYJfw4ylih3zuyirqJGbi73q mJOsRI5Mf796KuLVu06LlUNBFr7NHZpM8jVno= 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=Q7OJr2fNjgGIcJIqqF9ej5dw8+vyB2iSNpGREcUJdJ8=; b=HB2gZ4IDWa27gMstXBF4okZcowLawQHxsMVlelFe4Wmly0WrKgt3NZg5071F540jTi Jv/IKUjvcWnFV4S2erVed6n0Qx36TZrYO4zLknIKyHV+iMJ1d8r7uj3tFm+VJAhLlI0v Pe8RzKfvg5hODHkcV7qrGv8W6PhwPbx7YbdVQW1ssiRK/uZyCcjcIcAyNjQ11+Qay2mu qyibGpPPx5YhfEkPht3YHQIBLOQMRK9/fW8zhko4YCX4LHnUb6PiCVKsrsfkuAVZtOR/ xcOlIIIFLCP0ZI+9gtryfWdTcBua35PWcD8cZD94BS2XcDno9IkZFF9PX2DpeNBm35Dh r8uA== X-Gm-Message-State: AGi0PubgHdmjFvQa0lSMuFkv6DzGpPytt+ZUvDPqn13bvu4zlKgI/VCk k3cHuXgIY6u3sv1aPBgGoIljpQ== X-Google-Smtp-Source: APiQypKTOisFnohd+WRO0Z88W2Yg66YiWX7rj46BoIw2L57BnjAgP/PH17CP0/qQS37ikw0XH2izsw== X-Received: by 2002:adf:f3cc:: with SMTP id g12mr6637314wrp.427.1589188314245; Mon, 11 May 2020 02:11:54 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id t4sm17506299wri.54.2020.05.11.02.11.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2020 02:11:53 -0700 (PDT) From: Daniel Vetter To: LKML Date: Mon, 11 May 2020 11:11:41 +0200 Message-Id: <20200511091142.208787-2-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200511091142.208787-1-daniel.vetter@ffwll.ch> References: <20200511091142.208787-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 2/3] dma-fence: use default wait function for mock fences X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Intel Graphics Development , DRI Development , linaro-mm-sig@lists.linaro.org, Daniel Vetter , Sumit Semwal , linux-media@vger.kernel.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" No need to micro-optmize when we're waiting in a mocked object ... Signed-off-by: Daniel Vetter Cc: Sumit Semwal Cc: linux-media@vger.kernel.org Cc: linaro-mm-sig@lists.linaro.org Acked-by: Michael J. Ruhl --- drivers/dma-buf/st-dma-fence.c | 41 ---------------------------------- 1 file changed, 41 deletions(-) diff --git a/drivers/dma-buf/st-dma-fence.c b/drivers/dma-buf/st-dma-fence.c index e593064341c8..8166d2984702 100644 --- a/drivers/dma-buf/st-dma-fence.c +++ b/drivers/dma-buf/st-dma-fence.c @@ -33,50 +33,9 @@ static void mock_fence_release(struct dma_fence *f) kmem_cache_free(slab_fences, to_mock_fence(f)); } -struct wait_cb { - struct dma_fence_cb cb; - struct task_struct *task; -}; - -static void mock_wakeup(struct dma_fence *f, struct dma_fence_cb *cb) -{ - wake_up_process(container_of(cb, struct wait_cb, cb)->task); -} - -static long mock_wait(struct dma_fence *f, bool intr, long timeout) -{ - const int state = intr ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE; - struct wait_cb cb = { .task = current }; - - if (dma_fence_add_callback(f, &cb.cb, mock_wakeup)) - return timeout; - - while (timeout) { - set_current_state(state); - - if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &f->flags)) - break; - - if (signal_pending_state(state, current)) - break; - - timeout = schedule_timeout(timeout); - } - __set_current_state(TASK_RUNNING); - - if (!dma_fence_remove_callback(f, &cb.cb)) - return timeout; - - if (signal_pending_state(state, current)) - return -ERESTARTSYS; - - return -ETIME; -} - static const struct dma_fence_ops mock_ops = { .get_driver_name = mock_name, .get_timeline_name = mock_name, - .wait = mock_wait, .release = mock_fence_release, }; From patchwork Mon May 11 09:11:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11540039 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C2A2E14B4 for ; Mon, 11 May 2020 09:12:01 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A14EB2495A for ; Mon, 11 May 2020 09:12:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="h4rIFRGn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A14EB2495A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 368126E3FC; Mon, 11 May 2020 09:11:58 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id D530F6E3F9 for ; Mon, 11 May 2020 09:11:56 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id x17so9951790wrt.5 for ; Mon, 11 May 2020 02:11:56 -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=0CinOkbYS8oPgPVLI49BKt2JzQLqGPZqhctItxxwelA=; b=h4rIFRGn0yKy4FgF2CPDHTuSqgim5fjp6Ly9Ueas+XY00rIljDAeF2fRgJ3GyRmMva juSun8H2JFb0tKhLNykj5s7WbdhQtMrb6yKjQ3/EG1CrxrYWGuMXykVRWcToDMvHyZWd kwRsJAkax1d6Xmna3tnM/71z6J0ExhjpOI7pA= 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=0CinOkbYS8oPgPVLI49BKt2JzQLqGPZqhctItxxwelA=; b=Kkywp+Epfq4pP/2Cfrs5sYwSA4m/bZb4DMR5GdqsCzlP10vDs4YQkOIAeWxsg/B2Xl rVDZ1OqbAIRhkjDh9aJmIh5us2Eu28vDr9Ji1cB2fpPMPZkpCI6+X3A2AjEkKP8yM6s5 /g4AgY++zWkz336A/YDLKWrClT87LgIVRikSg5EZmHgAtpLhrZ9AFgZJKiwbBWEdtGDU 0nOSREeVGFN44s390NwimSJ7CQtKEIaluruG2ChJo5OmsyLBBdi1MfZJY+d5FK48aTtQ BRKTsYmyZ6Y+btNBtAhVDOLr3GoZv+vWPZ97FPCJ8P5d85MgyzvOqAiU3+eU9KEqxL8l kRWg== X-Gm-Message-State: AGi0PuYEbL71Ncq3Obo5k6+Nq1y3GnpURdBOYEIpYbQ3qPSM3foq84b4 PoaF9vude28tQMHAOHPesFLkzg== X-Google-Smtp-Source: APiQypIe/NcTRB7OjwoRrwiqdLysAONSgQ8XmUpqQiiFNg4nNfp3xqmACL1LU9lULCHwhJ4moMYGIg== X-Received: by 2002:adf:e582:: with SMTP id l2mr18950634wrm.392.1589188315492; Mon, 11 May 2020 02:11:55 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id t4sm17506299wri.54.2020.05.11.02.11.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2020 02:11:54 -0700 (PDT) From: Daniel Vetter To: LKML Date: Mon, 11 May 2020 11:11:42 +0200 Message-Id: <20200511091142.208787-3-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200511091142.208787-1-daniel.vetter@ffwll.ch> References: <20200511091142.208787-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 3/3] misc/habalabs: don't set default fence_ops->wait X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Oded Gabbay , Daniel Vetter , Intel Graphics Development , DRI Development , linaro-mm-sig@lists.linaro.org, Greg Kroah-Hartman , Olof Johansson , Daniel Vetter , Sumit Semwal , linux-media@vger.kernel.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" It's the default. Also so much for "we're not going to tell the graphics people how to review their code", dma_fence is a pretty core piece of gpu driver infrastructure. And it's very much uapi relevant, including piles of corresponding userspace protocols and libraries for how to pass these around. Would be great if habanalabs would not use this (from a quick look it's not needed at all), since open source the userspace and playing by the usual rules isn't on the table. If that's not possible (because it's actually using the uapi part of dma_fence to interact with gpu drivers) then we have exactly what everyone promised we'd want to avoid. Signed-off-by: Daniel Vetter Cc: Greg Kroah-Hartman Cc: Olof Johansson Cc: Oded Gabbay Cc: Sumit Semwal Cc: linux-media@vger.kernel.org Cc: linaro-mm-sig@lists.linaro.org --- drivers/misc/habanalabs/command_submission.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/misc/habanalabs/command_submission.c b/drivers/misc/habanalabs/command_submission.c index 409276b6374d..cc3ce759b6c3 100644 --- a/drivers/misc/habanalabs/command_submission.c +++ b/drivers/misc/habanalabs/command_submission.c @@ -46,7 +46,6 @@ static const struct dma_fence_ops hl_fence_ops = { .get_driver_name = hl_fence_get_driver_name, .get_timeline_name = hl_fence_get_timeline_name, .enable_signaling = hl_fence_enable_signaling, - .wait = dma_fence_default_wait, .release = hl_fence_release };