Message ID | 20211123142111.3885-20-christian.koenig@amd.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers |
Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from <linux-media-owner@vger.kernel.org>) id 1mpWgC-0087Rp-DS; Tue, 23 Nov 2021 14:21:52 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237069AbhKWOY7 (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Tue, 23 Nov 2021 09:24:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237636AbhKWOY6 (ORCPT <rfc822;linux-media@vger.kernel.org>); Tue, 23 Nov 2021 09:24:58 -0500 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 167A8C061574 for <linux-media@vger.kernel.org>; Tue, 23 Nov 2021 06:21:50 -0800 (PST) Received: by mail-wm1-x332.google.com with SMTP id o29so18892770wms.2 for <linux-media@vger.kernel.org>; Tue, 23 Nov 2021 06:21:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xR1nHIQR+HY5rurJTXhG523nepCCoi6AKz+ZxgPV9e4=; b=BTqipD6axEdvFS1qNdyue067ov95lW4E2a6zp708LmkVTtkeerVpwqnJhPFVrfumv5 xuFk26cb70nj8GVHRLOG39Vvc7V/P2EZdcXBxNZNOD2NsKSknt5c27AARzTevTtm2l+v IzcyNOSovh/8bHnvDDoZQM60pa9MIUQBtVINjJqOtiAhluOxMhPtqxK89mdvMu+vOyFX JLWKvlTQxKjNKHvhQVl8vfh+LMGXeWTb0Gz95PfKUPbVp58UHNSo96bX6Nn8H6Oh6mKO 1GyeZKiYXijk1nFVpBzuBdxGOBTnm7lFJbmry3asbr57LXcqvIAS3Wp4y6jmjODSdzFf KGCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xR1nHIQR+HY5rurJTXhG523nepCCoi6AKz+ZxgPV9e4=; b=h7WLVxhQyqffgQWn8Rix+hKSKg5ZRuBr2YdLWpkwHdAAs8r13Quf/imaIUydfMO1YX CeXgpkXlonq3xZA3i8biOWfedATmeTY0AxtNmS4RT1lD0Vd3yH6Z8kTpp1eKhmHq7ZFm pfQRKiAORCY+728S6EYUuWqa4ri2u0ozENj1kbSUqnWtned1i0l0O26h5txJbxLujIIV jE5llTnKRa6t4XExHQxw4mGqj978UzLwaOd0eHeZx50CCasvWL3fU0JaoSLnTyz+Uewc GEdX42PsUabDFseNVZcOGTSVrqOb/g4BlXBKOab9k2PDNrifB58ujsiCTvQ245V26ibU s0RQ== X-Gm-Message-State: AOAM533WXxal6bTb8S4VKFfgRs5nfU0Pc8QcGkHDwEbXRgL9W9H/1Sm5 gnCQRL4fSmWCjDeBB3Iv+AUE39AJ2RU= X-Google-Smtp-Source: ABdhPJwsYTfsgAB3lOAVoiiFf/7GcQC8rbzKcBIGp6cEfhtBHCNSmGTA2nFXLk/Ck8OjVaGW+Vb6rg== X-Received: by 2002:a7b:c444:: with SMTP id l4mr3443925wmi.115.1637677308688; Tue, 23 Nov 2021 06:21:48 -0800 (PST) Received: from abel.fritz.box (p57b0b77b.dip0.t-ipconnect.de. [87.176.183.123]) by smtp.gmail.com with ESMTPSA id t8sm1645928wmq.32.2021.11.23.06.21.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Nov 2021 06:21:48 -0800 (PST) From: " =?utf-8?q?Christian_K=C3=B6nig?= " <ckoenig.leichtzumerken@gmail.com> X-Google-Original-From: =?utf-8?q?Christian_K=C3=B6nig?= <christian.koenig@amd.com> To: sumit.semwal@linaro.org, daniel@ffwll.ch Cc: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org Subject: [PATCH 19/26] drm: support more than one write fence in drm_gem_plane_helper_prepare_fb Date: Tue, 23 Nov 2021 15:21:04 +0100 Message-Id: <20211123142111.3885-20-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211123142111.3885-1-christian.koenig@amd.com> References: <20211123142111.3885-1-christian.koenig@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,FREEMAIL_FORGED_FROMDOMAIN=0.001,FREEMAIL_FROM=0.001,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no |
Series |
[01/26] drm/amdgpu: partially revert "svm bo enable_signal call condition"
|
|
Commit Message
Christian König
Nov. 23, 2021, 2:21 p.m. UTC
Use dma_resv_get_singleton() here to eventually get more than one write
fence as single fence.
Signed-off-by: Christian König <christian.koenig@amd.com>
---
drivers/gpu/drm/drm_gem_atomic_helper.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
Comments
On Tue, Nov 23, 2021 at 03:21:04PM +0100, Christian König wrote: > Use dma_resv_get_singleton() here to eventually get more than one write > fence as single fence. Yeah this is nice, atomic commit helpers not supporting multiple write fences was really my main worry in this entire endeavour. Otherwise looks all rather reasonable. I'll try to find some review bandwidth, but would be really if you can volunteer others too (especially making sure ttm drivers set the KERNEL fences correctly in all cases). -Daniel > > Signed-off-by: Christian König <christian.koenig@amd.com> > --- > drivers/gpu/drm/drm_gem_atomic_helper.c | 18 +++++++----------- > 1 file changed, 7 insertions(+), 11 deletions(-) > > diff --git a/drivers/gpu/drm/drm_gem_atomic_helper.c b/drivers/gpu/drm/drm_gem_atomic_helper.c > index c3189afe10cb..9338ddb7edff 100644 > --- a/drivers/gpu/drm/drm_gem_atomic_helper.c > +++ b/drivers/gpu/drm/drm_gem_atomic_helper.c > @@ -143,25 +143,21 @@ > */ > int drm_gem_plane_helper_prepare_fb(struct drm_plane *plane, struct drm_plane_state *state) > { > - struct dma_resv_iter cursor; > struct drm_gem_object *obj; > struct dma_fence *fence; > + int ret; > > if (!state->fb) > return 0; > > obj = drm_gem_fb_get_obj(state->fb, 0); > - dma_resv_iter_begin(&cursor, obj->resv, false); > - dma_resv_for_each_fence_unlocked(&cursor, fence) { > - /* TODO: Currently there should be only one write fence, so this > - * here works fine. But drm_atomic_set_fence_for_plane() should > - * be changed to be able to handle more fences in general for > - * multiple BOs per fb anyway. */ > - dma_fence_get(fence); > - break; > - } > - dma_resv_iter_end(&cursor); > + ret = dma_resv_get_singleton(obj->resv, false, &fence); > + if (ret) > + return ret; > > + /* TODO: drm_atomic_set_fence_for_plane() should be changed to be able > + * to handle more fences in general for multiple BOs per fb. > + */ > drm_atomic_set_fence_for_plane(state, fence); > return 0; > } > -- > 2.25.1 >
Am 25.11.21 um 16:47 schrieb Daniel Vetter: > On Tue, Nov 23, 2021 at 03:21:04PM +0100, Christian König wrote: >> Use dma_resv_get_singleton() here to eventually get more than one write >> fence as single fence. > Yeah this is nice, atomic commit helpers not supporting multiple write > fences was really my main worry in this entire endeavour. Otherwise looks > all rather reasonable. > > I'll try to find some review bandwidth, but would be really if you can > volunteer others too (especially making sure ttm drivers set the KERNEL > fences correctly in all cases). Maybe I should split that up into switching over to adding the enum and then switching to kernel/bookkeep(previously other) for some use cases. It would be good if I could get an rb on the trivial driver cleanups first. I can send those out individually if that helps. Thanks, Christian. > -Daniel > > >> Signed-off-by: Christian König <christian.koenig@amd.com> >> --- >> drivers/gpu/drm/drm_gem_atomic_helper.c | 18 +++++++----------- >> 1 file changed, 7 insertions(+), 11 deletions(-) >> >> diff --git a/drivers/gpu/drm/drm_gem_atomic_helper.c b/drivers/gpu/drm/drm_gem_atomic_helper.c >> index c3189afe10cb..9338ddb7edff 100644 >> --- a/drivers/gpu/drm/drm_gem_atomic_helper.c >> +++ b/drivers/gpu/drm/drm_gem_atomic_helper.c >> @@ -143,25 +143,21 @@ >> */ >> int drm_gem_plane_helper_prepare_fb(struct drm_plane *plane, struct drm_plane_state *state) >> { >> - struct dma_resv_iter cursor; >> struct drm_gem_object *obj; >> struct dma_fence *fence; >> + int ret; >> >> if (!state->fb) >> return 0; >> >> obj = drm_gem_fb_get_obj(state->fb, 0); >> - dma_resv_iter_begin(&cursor, obj->resv, false); >> - dma_resv_for_each_fence_unlocked(&cursor, fence) { >> - /* TODO: Currently there should be only one write fence, so this >> - * here works fine. But drm_atomic_set_fence_for_plane() should >> - * be changed to be able to handle more fences in general for >> - * multiple BOs per fb anyway. */ >> - dma_fence_get(fence); >> - break; >> - } >> - dma_resv_iter_end(&cursor); >> + ret = dma_resv_get_singleton(obj->resv, false, &fence); >> + if (ret) >> + return ret; >> >> + /* TODO: drm_atomic_set_fence_for_plane() should be changed to be able >> + * to handle more fences in general for multiple BOs per fb. >> + */ >> drm_atomic_set_fence_for_plane(state, fence); >> return 0; >> } >> -- >> 2.25.1 >>
On Fri, Nov 26, 2021 at 11:30:19AM +0100, Christian König wrote: > Am 25.11.21 um 16:47 schrieb Daniel Vetter: > > On Tue, Nov 23, 2021 at 03:21:04PM +0100, Christian König wrote: > > > Use dma_resv_get_singleton() here to eventually get more than one write > > > fence as single fence. > > Yeah this is nice, atomic commit helpers not supporting multiple write > > fences was really my main worry in this entire endeavour. Otherwise looks > > all rather reasonable. > > > > I'll try to find some review bandwidth, but would be really if you can > > volunteer others too (especially making sure ttm drivers set the KERNEL > > fences correctly in all cases). > > Maybe I should split that up into switching over to adding the enum and then > switching to kernel/bookkeep(previously other) for some use cases. > > It would be good if I could get an rb on the trivial driver cleanups first. > I can send those out individually if that helps. Yeah some of the conversion patches might make sense to be split a bit more. Especially when there's functional changes hiding, but I tought you've split them out? But didn't read them in detail. Either way for stuff like this I think it's always best to split the mechanical stuff from the concept intro/docs and functional changes, except when it's really very obvious what's going on and just as small patch. -Daniel > > Thanks, > Christian. > > > -Daniel > > > > > > > Signed-off-by: Christian König <christian.koenig@amd.com> > > > --- > > > drivers/gpu/drm/drm_gem_atomic_helper.c | 18 +++++++----------- > > > 1 file changed, 7 insertions(+), 11 deletions(-) > > > > > > diff --git a/drivers/gpu/drm/drm_gem_atomic_helper.c b/drivers/gpu/drm/drm_gem_atomic_helper.c > > > index c3189afe10cb..9338ddb7edff 100644 > > > --- a/drivers/gpu/drm/drm_gem_atomic_helper.c > > > +++ b/drivers/gpu/drm/drm_gem_atomic_helper.c > > > @@ -143,25 +143,21 @@ > > > */ > > > int drm_gem_plane_helper_prepare_fb(struct drm_plane *plane, struct drm_plane_state *state) > > > { > > > - struct dma_resv_iter cursor; > > > struct drm_gem_object *obj; > > > struct dma_fence *fence; > > > + int ret; > > > if (!state->fb) > > > return 0; > > > obj = drm_gem_fb_get_obj(state->fb, 0); > > > - dma_resv_iter_begin(&cursor, obj->resv, false); > > > - dma_resv_for_each_fence_unlocked(&cursor, fence) { > > > - /* TODO: Currently there should be only one write fence, so this > > > - * here works fine. But drm_atomic_set_fence_for_plane() should > > > - * be changed to be able to handle more fences in general for > > > - * multiple BOs per fb anyway. */ > > > - dma_fence_get(fence); > > > - break; > > > - } > > > - dma_resv_iter_end(&cursor); > > > + ret = dma_resv_get_singleton(obj->resv, false, &fence); > > > + if (ret) > > > + return ret; > > > + /* TODO: drm_atomic_set_fence_for_plane() should be changed to be able > > > + * to handle more fences in general for multiple BOs per fb. > > > + */ > > > drm_atomic_set_fence_for_plane(state, fence); > > > return 0; > > > } > > > -- > > > 2.25.1 > > > >
diff --git a/drivers/gpu/drm/drm_gem_atomic_helper.c b/drivers/gpu/drm/drm_gem_atomic_helper.c index c3189afe10cb..9338ddb7edff 100644 --- a/drivers/gpu/drm/drm_gem_atomic_helper.c +++ b/drivers/gpu/drm/drm_gem_atomic_helper.c @@ -143,25 +143,21 @@ */ int drm_gem_plane_helper_prepare_fb(struct drm_plane *plane, struct drm_plane_state *state) { - struct dma_resv_iter cursor; struct drm_gem_object *obj; struct dma_fence *fence; + int ret; if (!state->fb) return 0; obj = drm_gem_fb_get_obj(state->fb, 0); - dma_resv_iter_begin(&cursor, obj->resv, false); - dma_resv_for_each_fence_unlocked(&cursor, fence) { - /* TODO: Currently there should be only one write fence, so this - * here works fine. But drm_atomic_set_fence_for_plane() should - * be changed to be able to handle more fences in general for - * multiple BOs per fb anyway. */ - dma_fence_get(fence); - break; - } - dma_resv_iter_end(&cursor); + ret = dma_resv_get_singleton(obj->resv, false, &fence); + if (ret) + return ret; + /* TODO: drm_atomic_set_fence_for_plane() should be changed to be able + * to handle more fences in general for multiple BOs per fb. + */ drm_atomic_set_fence_for_plane(state, fence); return 0; }