Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp46670pxh; Thu, 7 Apr 2022 13:32:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzOnvBbSY5w6DryC/TI8j0HBmprjvzcwITwEDV11Apc1I5Uq09avXrCskRM4/mHLdJtYIf X-Received: by 2002:a17:90b:4f4e:b0:1cb:319a:da59 with SMTP id pj14-20020a17090b4f4e00b001cb319ada59mr2141727pjb.10.1649363556798; Thu, 07 Apr 2022 13:32:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649363556; cv=none; d=google.com; s=arc-20160816; b=XKZIcVYDsNQBs2fgaSLhS2QlbXUrkQUvVwT5ZTlDo9uYTg6NOELuhFS6yDmcWwmzCf IEczHk31I8+T/kpMqQ5Fbs513o0qmDnTFdzxBECFaGOkjze5+aTz8JhRz4nzXliiSXDr GmuR+TsZOhYZKUO6JdBZDxSWH/Smn5VCIfT6X5RdekhBwNqfGpmNnQsDmIyA+bQrCk7F Oo4SQtHyBmF9LwP4elwLTbkaDM6LaDHgLmEZHYfI+4sNecZ8el6o2C7kLOWbVh86hHpX hmuCA1REj8v8a70IPozxO9f2rVWFIlku8FvO6onU6oa9pVExA46B90NYa8qEvBW3yBRC Dgtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=mTxiSR/6vtNPZOIf/OP7ggVw8g8GmZlP0MOMFHDsP7g=; b=PJf1X9MVk6BbTU1DWhPBO+AyaSKGiiarGRK29BSTDy6kQjtXOsyBBVzxWkvapxh21W HJqNBYWAGcqxO1ctVUjx/EAmrSWdIQrIwCLM1AvS22SqkozC5aue8DTlR99WNQ06jo0B uBjAz8K0+Ky3bBoWcDGhD/LOe/DY2RgF23hSNlF51UeI790aQ3GLPBcpvrAMifJ3w0Re HXsC810lZVVIwJSklIeUvLFWFY/0jcY7JoUfcysSmcdYhLoW/pfpFbNPa+NfviR2ZJr+ godVhPnzl08qokv+fpoQIj2SCfxVQj27fQ5Xp1+PZ3iUnuIYgsNTfhYCDdR/Vd3d7qBI PySw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=bNraVnOH; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id e20-20020a63d954000000b003816043efa5si12009160pgj.410.2022.04.07.13.32.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 13:32:36 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=bNraVnOH; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 42B23396AF5; Thu, 7 Apr 2022 12:46:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239002AbiDGKA2 (ORCPT + 99 others); Thu, 7 Apr 2022 06:00:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242642AbiDGKA1 (ORCPT ); Thu, 7 Apr 2022 06:00:27 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A31541546B9; Thu, 7 Apr 2022 02:58:27 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dmitry.osipenko) with ESMTPSA id 18CC71F45CC6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1649325506; bh=4JhwlWRjO0CnzyWEzVO1sVOFEnHl7+kZT9rj4eGLerw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=bNraVnOH9Rg8cMTjWdgj0JSpgVHxQRUECNA+C7JwxDOZVVd0Rs+ZVbOD6eCeaEUK4 amfTO9YV0GuLdFz5iQU1LRj6lTD/kORLNt0j/xbgUUK+DAYcw1UeWYIEwFFurSEVhO j1i1gLkCk2q2rA1sQUjmeR3ODlI9uncSekbN41AqAnmfqfVFbolxRbb0H47irTI3wc XdQzJ0Srp5LbqDY/5actT3/tKAK+c2CaKD9XMyjzyQ0gpM7VdaBSrSVboK5Qv6JQyF QEv1uO6wjLeDoGRDLnuLFlxTBZaJt4DgjSehnVKF8PNKUBHK+7TK7nXC9lvWS7QKQh zxwjFqJZp6v6w== Message-ID: <2fd35c28-0911-df87-c7e4-f7cbdba1f09d@collabora.com> Date: Thu, 7 Apr 2022 12:58:22 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v3 10/10] drm/msm: Add a way for userspace to allocate GPU iova Content-Language: en-US To: Rob Clark , dri-devel@lists.freedesktop.org Cc: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Dmitry Baryshkov , Rob Clark , Sean Paul , Abhinav Kumar , David Airlie , Daniel Vetter , Akhil P Oommen , Jonathan Marek , Jordan Crouse , Emma Anholt , Dan Carpenter , open list References: <20220406214636.1156978-1-robdclark@gmail.com> <20220406214636.1156978-11-robdclark@gmail.com> From: Dmitry Osipenko In-Reply-To: <20220406214636.1156978-11-robdclark@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/7/22 00:46, Rob Clark wrote: > From: Rob Clark > > The motivation at this point is mainly native userspace mesa driver in a > VM guest. The one remaining synchronous "hotpath" is buffer allocation, > because guest needs to wait to know the bo's iova before it can start > emitting cmdstream/state that references the new bo. By allocating the > iova in the guest userspace, we no longer need to wait for a response > from the host, but can just rely on the allocation request being > processed before the cmdstream submission. Allocation failures (OoM, > etc) would just be treated as context-lost (ie. GL_GUILTY_CONTEXT_RESET) > or subsequent allocations (or readpix, etc) can raise GL_OUT_OF_MEMORY. > > v2: Fix inuse check > v3: Change mismatched iova case to -EBUSY > > Signed-off-by: Rob Clark > Reviewed-by: Dmitry Baryshkov > --- > drivers/gpu/drm/msm/adreno/adreno_gpu.c | 10 ++++++ > drivers/gpu/drm/msm/msm_drv.c | 21 +++++++++++ > drivers/gpu/drm/msm/msm_gem.c | 48 +++++++++++++++++++++++++ > drivers/gpu/drm/msm/msm_gem.h | 8 +++++ > drivers/gpu/drm/msm/msm_gem_vma.c | 2 ++ > include/uapi/drm/msm_drm.h | 3 ++ > 6 files changed, 92 insertions(+) Reviewed-by: Dmitry Osipenko