From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Osipenko Subject: Re: [RFC] Host1x/TegraDRM UAPI (drm_tegra_submit_relocation) Date: Fri, 26 Jun 2020 01:50:51 +0300 Message-ID: References: <9b06b7ec-f952-2561-7afb-5653514cd5d3@kapsi.fi> <7cc0d47b-024a-263e-3b63-1d1184b462b3@gmail.com> <8d60baf4-45e8-296a-279e-dc105966361c@kapsi.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <8d60baf4-45e8-296a-279e-dc105966361c-/1wQRMveznE@public.gmane.org> Content-Language: en-US Sender: linux-tegra-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Mikko Perttunen , Thierry Reding , Jon Hunter , David Airlie , Daniel Vetter , sumit.semwal-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, gustavo-THi1TnShQwVAfugRpC6u6w@public.gmane.org Cc: "linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , dri-devel , talho-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org, bhuntsman-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org List-Id: linux-tegra@vger.kernel.org 25.06.2020 12:27, Mikko Perttunen пишет: > On 6/25/20 1:33 AM, Dmitry Osipenko wrote: >> 23.06.2020 15:09, Mikko Perttunen пишет: >>> struct drm_tegra_submit_relocation { >>>          /* [in] Index of GATHER or GATHER_UPTR command in commands. */ >>>          __u32 gather_command_index; >>> >>>          /* >>>           * [in] Mapping handle (obtained through CHANNEL_MAP) of the >>> memory >>>           *   the address of which will be patched in. >>>           */ >>>          __u32 mapping_id; >>> >>>          /* >>>           * [in] Offset in the gather that will be patched. >>>           */ >>>          __u64 gather_offset; >>> >>>          /* >>>           * [in] Offset in target buffer whose paddr/IOVA will be >>> written >>>           *   to the gather. >>>           */ >>>          __u64 target_offset; >>> >>>          /* >>>           * [in] Number of bits the resulting address will be logically >>>           *   shifted right before writing to gather. >>>           */ >>>          __u32 shift; >>> >>>          __u32 reserved[1]; >>> }; >> >> We will also need read/write direction flag here for the >> DMA-reservations set up, it will be used for the implicit BO fencing by >> the job's scheduler. >> > > Ideally on newer chips with context isolation, we no longer know what > DMA-BUFs are being used by the job at submit time - they would just be > pointers after being MAPped. The DMA-BUFs themselves shouldn't be needed, but GEMs should. > Do you know how other GPUs deal with DMA reservations - I expect > separate MAP and SUBMIT steps would be pretty common? I can't instantly recall what other drivers do, could be worthwhile to take a closer look. > Do you have to > pass the DMA-BUF to both steps (i.e. do IOMMU mapping during MAP, and > manage reservations at SUBMIT)? Yes, this sounds good to me if DMA-BUF part is replaced with a GEM. Please see my other reply regarding the MAP IOCTL where I'm suggesting to back mapping IDs with a GEM. 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=-2.3 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 5EC4FC433E0 for ; Fri, 26 Jun 2020 07:37:03 +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 34C6C20775 for ; Fri, 26 Jun 2020 07:37:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VHzu87QK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 34C6C20775 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E660A6EC43; Fri, 26 Jun 2020 07:36:19 +0000 (UTC) Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by gabe.freedesktop.org (Postfix) with ESMTPS id E972E6E045 for ; Thu, 25 Jun 2020 22:50:54 +0000 (UTC) Received: by mail-lf1-x141.google.com with SMTP id c21so4111920lfb.3 for ; Thu, 25 Jun 2020 15:50:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=1byI84A1taS+jyeFTLN0XYFRgDGLuM/PTKl1uJXzto8=; b=VHzu87QK5SbM/3R0eKocVe9eak+kYN52JFUFpF/aYoPf1FpTtcnUEmdi28naOjF6/p cOBuMiGZMCrJGUrt5x5VSvTl8Vd/VPeg4wDYpvKsL453RXsa/IqfIPcpwMadA2tuNPnw 6NIM2sJbD0KBVRUDBvZACd2emB/cNH4lPxHlpVJJinRChD2NzddpdxNPXElIk+0ZpQOP abZTXTaH2JVgGkZwfib3ms04xNO84Cvzalu8gVjprYfXP08bkVSy9KSVwvdva90c55QM /p1JuDhwr4BorHz7iJyGMR0bKOmDGyaFEGsY0OajO2eOf6Y/rXVdOCo6HTmv+z7YDbKj UXIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1byI84A1taS+jyeFTLN0XYFRgDGLuM/PTKl1uJXzto8=; b=SPqUhiNbHk2FfuhC2JtHptaiIRpZykeRax6WNs3eYsNZAar+DcdYx37Ldb5qBoaO66 1VKrFTBQiMEikKy4W6ensv95LgU8G27Kl2fh+uMJLBeZMNctNBjpJz/z6u3cYypvn8aK V6XY61zgDcCnvh8Q6JGuE3xuI6YeifXvpV1PbU5tFTYztWm+CNVOfFc+N0yIDvAib9ik trDacwSE/ZuosH4N9EcBwLmdQ1NYjhNLibPxXWxQM7yKStuTrBg1bxQCqQRpIODczWMI PeKiQ4FwByRsauE/k4ErK+njOwPiS9HHJdp9n3St9qLv1kGjQbRwTtZWCZcavvTELL5D QaJg== X-Gm-Message-State: AOAM531OPXk3quNpx8A7V90xbe/OXizTr8ZHKx3M3twUGNlR779OjHJp kJ8GdHkamhsNCxq3QGxHqy4= X-Google-Smtp-Source: ABdhPJxsG8eY7FoghI/aJTlV3ecDuy0RQuMpKsAqomxJRhzs+FdHGa0XBgIi9Nz0rlmnN+0cxk9Q8A== X-Received: by 2002:a05:6512:31c5:: with SMTP id j5mr178183lfe.26.1593125453321; Thu, 25 Jun 2020 15:50:53 -0700 (PDT) Received: from [192.168.2.145] (79-139-237-54.dynamic.spd-mgts.ru. [79.139.237.54]) by smtp.googlemail.com with ESMTPSA id 203sm2377129ljf.14.2020.06.25.15.50.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 Jun 2020 15:50:52 -0700 (PDT) Subject: Re: [RFC] Host1x/TegraDRM UAPI (drm_tegra_submit_relocation) To: Mikko Perttunen , Thierry Reding , Jon Hunter , David Airlie , Daniel Vetter , sumit.semwal@linaro.org, gustavo@padovan.org References: <9b06b7ec-f952-2561-7afb-5653514cd5d3@kapsi.fi> <7cc0d47b-024a-263e-3b63-1d1184b462b3@gmail.com> <8d60baf4-45e8-296a-279e-dc105966361c@kapsi.fi> From: Dmitry Osipenko Message-ID: Date: Fri, 26 Jun 2020 01:50:51 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <8d60baf4-45e8-296a-279e-dc105966361c@kapsi.fi> Content-Language: en-US X-Mailman-Approved-At: Fri, 26 Jun 2020 07:36:15 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-tegra@vger.kernel.org" , talho@nvidia.com, bhuntsman@nvidia.com, dri-devel Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" MjUuMDYuMjAyMCAxMjoyNywgTWlra28gUGVydHR1bmVuINC/0LjRiNC10YI6Cj4gT24gNi8yNS8y MCAxOjMzIEFNLCBEbWl0cnkgT3NpcGVua28gd3JvdGU6Cj4+IDIzLjA2LjIwMjAgMTU6MDksIE1p a2tvIFBlcnR0dW5lbiDQv9C40YjQtdGCOgo+Pj4gc3RydWN0IGRybV90ZWdyYV9zdWJtaXRfcmVs b2NhdGlvbiB7Cj4+PiDCoMKgwqDCoMKgwqDCoMKgIC8qIFtpbl0gSW5kZXggb2YgR0FUSEVSIG9y IEdBVEhFUl9VUFRSIGNvbW1hbmQgaW4gY29tbWFuZHMuICovCj4+PiDCoMKgwqDCoMKgwqDCoMKg IF9fdTMyIGdhdGhlcl9jb21tYW5kX2luZGV4Owo+Pj4KPj4+IMKgwqDCoMKgwqDCoMKgwqAgLyoK Pj4+IMKgwqDCoMKgwqDCoMKgwqDCoCAqIFtpbl0gTWFwcGluZyBoYW5kbGUgKG9idGFpbmVkIHRo cm91Z2ggQ0hBTk5FTF9NQVApIG9mIHRoZQo+Pj4gbWVtb3J5Cj4+PiDCoMKgwqDCoMKgwqDCoMKg wqAgKsKgwqAgdGhlIGFkZHJlc3Mgb2Ygd2hpY2ggd2lsbCBiZSBwYXRjaGVkIGluLgo+Pj4gwqDC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