Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp279359imj; Fri, 15 Feb 2019 23:49:00 -0800 (PST) X-Google-Smtp-Source: AHgI3IbzwYpzSE4CW8YmU4/ugUY06ocjqnOUaGnWbDjx78HFjDSfzfxG9srFYyUF4QAjFeeZA8JB X-Received: by 2002:a17:902:2e03:: with SMTP id q3mr14709981plb.330.1550303340609; Fri, 15 Feb 2019 23:49:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550303340; cv=none; d=google.com; s=arc-20160816; b=0/L3yUIjBGfAdY2+rpM5KQlyPYe5RaEDnLDi9yDNGA0PjUCDwxa70Kg/RNYLhYoyfF dqi1HhG3P0UNqFXu9+JVgRByYhO8+UFoYEW4qZyfxVSY2Ty43p22d16RM72tyCJnhH6b RaDHcJDuCURgQY8vdw2219Ckl5MFtD8uZarVmWWODycH6Tnat4138aJGZ/BSZQaPPDLc 7VNANoZNyXbK4/6T7xOgZug/twg+1pbkn+MoOAgmBsc9JU6d21lm/1KlPsXS/UMGkFvS c8uFTmpXJZmTbc8/CPLqTLi18+SR/zQxvSPgjNPn9XpjUkRnMWzFJC+9VKcSuTXPiDhO yQ8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=VADwBkT847c4aOiIkdkR9YLvQNw66R551EDkGw96awk=; b=hWz+gWLHjw4rFmuyPbMNbUJi9nSg4IVGqSWgWvXrXfzQvnVoc+s63500swYngqcgd8 m4g9ZxtfEt6+4s9nKPo9pFQbE0Hy4ovZiwrbWyk35/qn0fsNnlIa4Obu30rMRsMgAccA NskMT9iH6ocypXmTAMUI31VenTknFB+Pxz1UDSo19Wl8EjoEM1T7z+B6hJ5UC4z+SSIn TDS8kgj44S2easOQJEh2U+nC1xn+a6khwJ4tGruVJ9NGQBPQk0orK0eQR/bUizkE0trv nZfazVyhbPOr52sFiQIjojriwWEHVDI5/m7vlsMGs432qPcp40bgAAPaPzWEJB4xjpMy S1+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=It8F+c8O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v11si6998338pgr.20.2019.02.15.23.48.45; Fri, 15 Feb 2019 23:49:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=It8F+c8O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391912AbfBOVPO (ORCPT + 99 others); Fri, 15 Feb 2019 16:15:14 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:34033 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387600AbfBOVPO (ORCPT ); Fri, 15 Feb 2019 16:15:14 -0500 Received: by mail-wr1-f68.google.com with SMTP id f14so11805305wrg.1 for ; Fri, 15 Feb 2019 13:15:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VADwBkT847c4aOiIkdkR9YLvQNw66R551EDkGw96awk=; b=It8F+c8OyP4FK+4MuoQpsanlzZ3WZTFldM914Xab6exkiKDCu9GknyvQIsVd0HGJ08 HEN4FHfsL4LcOYhNSIU1GIKUrOW04LqSQdhxK/lFEUWmcEFYl+eSG7Bn6+iPVTrjvxht vx3QaNze8o7IfV0+ucXZ+rjxH8//eSEIwFUVrrmin6O1tCI4FtVsIzasTmu+hwfoGGBo IZzxwOaLtzAgowwm1xLPaUP3hQB4b96OZad4i4FxozYunbQevU/4GClxAMNkALNMT1jW 6YMxLyRb+E42aIrTBh+AI3KxQ/6XeZi0Cu0z/3taFa/blovZGnHmp/TvyGSnhwH0Yz1y Cgsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VADwBkT847c4aOiIkdkR9YLvQNw66R551EDkGw96awk=; b=pMnFNr1/oXlVe/hRMf7bW+P/f4gzmFIXyBNHDArh99w4AIEiOMucyUVsfnXDvvB913 ZISuSJAmozLD4/nBNbuTdzn7auEMsGbe4bZ5/gFsP46fJyg231Aptm1JFRPAegmStZu6 26M5Seh8+PLAcabMittyiPckBO8L76wNnUt34QCEYs/tXUHbWq+y3Jac4+5sJdDWoxRc XnvGex4m7rDLIRmc/a68onk37e2nJNmhdRQ1T9+ymmYUfEqYLXa0C8k2Sg7BJ4zWa/MR 8vSRtVi0uWeuJKLikdQPhke3GLNCjJ2eFzqckawh4XUoJKRAkYiAOUIL3Xk2hBIjpfYo Umbg== X-Gm-Message-State: AHQUAubo105ezKv47MoOdN3vvoQXPTrNMd35qyhEVksUfpA4gGpyTcno 1gaCkRqQs+8GV8JvjkZEOZyRHdHxIIaalkr4ZKnZ2A== X-Received: by 2002:adf:fa51:: with SMTP id y17mr8606129wrr.233.1550265311833; Fri, 15 Feb 2019 13:15:11 -0800 (PST) MIME-Version: 1.0 References: <20190128214408.25442-1-afd@ti.com> <20190215105057.jujgm4k77rhkvmo7@DESKTOP-E1NTVVP.localdomain> <0cc81357-034b-9c74-8172-2a7a26e77804@ti.com> In-Reply-To: From: John Stultz Date: Fri, 15 Feb 2019 13:15:00 -0800 Message-ID: Subject: Re: [PATCH v2] staging: android: ion: Allocate from heap ID directly without mask To: "Andrew F. Davis" Cc: Brian Starkey , Laura Abbott , Sumit Semwal , Greg Kroah-Hartman , =?UTF-8?B?QXJ2ZSBIasO4bm5ldsOlZw==?= , Christoph Hellwig , Liam Mark , "devel@driverdev.osuosl.org" , lkml , dri-devel , nd Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 15, 2019 at 12:52 PM Andrew F. Davis wrote: > On 2/15/19 1:58 PM, John Stultz wrote: > > So yea, I don't think we should tie our hands in reworking the > > interfaces, but it would be nice to avoid having subtle ABI changes > > that don't have clear ways for userland to detect which interface > > version its using. > > > > Let me preference this by pointing out I've dealt with the same pain > internally with our Android and soon to also in AOSP for the Beagle x15 > boards[0].. But my stance matches Christoph's in the other ION thread: > > https://lkml.org/lkml/2019/1/19/53 > > The more freely we can make ABI changes here in staging the quicker we > can get this out of staging where the ABI can be locked down. > ION_IOC_VERSION should solve this anyway. If there is real momentum to destaging and locking the ABI down, that's great! I just want to avoid lots of little incompatible changes that don't get us fully out of staging and cause tons of pain for folks trying to make it work (because at that point, its easier for folks to stick to their own out of tree solutions). > > So my initial thought is we simply use a /dev/ion_heaps/ dir which has > > a list of heap devicenodes. /dev/ion goes away. > > > > Currently ION_IOC_HEAP_QUERY returns: > > char name[MAX_HEAP_NAME]; > > __u32 type; > > __u32 heap_id; > > > > The names are discoverable via "ls /dev/ion_heaps/" > > > > The heap_id is really only useful as a handle, and after opening the > > heap device, we'll have the fd to use. > > > > So why have heap_id at all then? > Good question! I'm hoping we can yank them, though internally I didn't quite get there with my first patchset. :) > > But to match the use case you describe: > > 1) ls /dev/ion_heaps/ for a list of heaps > > Yuk, dirent.h and friends :( Yea, its not super fun, but its a standard interface, and the ugly bits can be done once in the helper library. > > Does that sound reasonable? And I don't really mean to dismiss the > > dynamic picking of the best heap part, and having something like a > > opaque constraints bitfield that each device and each heap export so > > userland can match things up would be great. But since we don't have > > any real solutions there yet(still!), it seems like most gralloc > > implementations are likely to be fully knowing which heap they want at > > allocation time. > > > > I think you already touched on my main issue with this, the dynamic > picking not supported. Well, like you said it doesn't really exist now > either. And this doesn't look to stop one from adding it as some ioctl > extensions.. > > Okay, looks like you posted an RFC, lets move the discussion over to > that thread. Sounds good. I look forward to your input! thanks -john