From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FA3DC47096 for ; Thu, 3 Jun 2021 07:48:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 87827613E3 for ; Thu, 3 Jun 2021 07:48:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229775AbhFCHtx (ORCPT ); Thu, 3 Jun 2021 03:49:53 -0400 Received: from foss.arm.com ([217.140.110.172]:34558 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229635AbhFCHtw (ORCPT ); Thu, 3 Jun 2021 03:49:52 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5B27D11FB; Thu, 3 Jun 2021 00:48:08 -0700 (PDT) Received: from [192.168.1.179] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3F32B3F774; Thu, 3 Jun 2021 00:48:06 -0700 (PDT) Subject: Re: [PATCH 03/11] drm/panfrost: Use xarray and helpers for depedency tracking To: Daniel Vetter Cc: Daniel Vetter , DRI Development , Intel Graphics Development , =?UTF-8?Q?Christian_K=c3=b6nig?= , Luben Tuikov , Alex Deucher , Lee Jones , Rob Herring , Tomeu Vizoso , Alyssa Rosenzweig , Sumit Semwal , linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, Daniel Vetter References: <20210521090959.1663703-1-daniel.vetter@ffwll.ch> <20210521090959.1663703-3-daniel.vetter@ffwll.ch> <2054fee7-dcd2-a4fa-5d50-7fe6f1b474be@arm.com> From: Steven Price Message-ID: Date: Thu, 3 Jun 2021 08:48:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On 02/06/2021 19:51, Daniel Vetter wrote: > On Wed, Jun 02, 2021 at 03:06:50PM +0100, Steven Price wrote: >> On 21/05/2021 10:09, Daniel Vetter wrote: [...] >>> + if (!xa_empty(&job->deps)) >>> + return xa_erase(&job->deps, job->last_dep++); >> >> Rather than tracking last_dep separately this could be written using >> xa_find(): >> >> if (xa_find(&job->deps, &i, ULONG_MAX, XA_PRESENT)) >> return xa_erase(&job->deps, &i); > > I copypasted this from other drivers, imo consistency is better than > looking pretty. I think eventually we should stuff this as optional > helpers into drm/scheduler. > > Also yours walks the xa twice. Agreed this isn't as efficient (I was somewhat disappointed xarray doesn't expose a "get and remove the first element" API). Moving this into drm/scheduler seems like the right long term solution - so matching other drivers first is a good move. Thanks, Steve