From patchwork Wed Sep 27 13:20:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 114365 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp5033932qgf; Wed, 27 Sep 2017 06:20:24 -0700 (PDT) X-Received: by 10.159.194.137 with SMTP id y9mr1284405pln.77.1506518424774; Wed, 27 Sep 2017 06:20:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506518424; cv=none; d=google.com; s=arc-20160816; b=F3wvxj9T8EDkgWY4bZnn0mmZ+4fzxZNiFjyILgWNQVZq3itxa41Z8QgPnY0LlMl5LH 1gVUYX83kiixzQxfHwJr7nzf4qq/kKk7qkYlSZkV+gTiWZDavRaV/qxUtvKgttpO31qf AsGqaHJn2aqZxswYNE/DKGlGeOY74HndKXHgtgwJR7JWrpE9nQxZmgWt4A95/6iVlfq/ +xSUIUeKaTQzKMgP3yLnpM+il7AKnTc+Vkv2Fszr1fz17mq7ZrgTNj+9M7T+89NmHVpL 4BJRIko400lSHAwQvdc9mMVc9XvedJ2AW94EVrX7Atkp3kh0DFpme0KoQ0NyqccCV6S0 gIZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:message-id:date:subject:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=hiyKkNW1f6eyJ3+WAe6HU1Z87haB0w3zYj4EFw4wZQI=; b=MvMnK1I8UdYru50YY5eHXYVibKApelkEeXNJ/NkeRRCykETwyqBob4sdi/us78RFC3 Equ75cuz2A8+TuYZy7/6rGz/vc983ZmeFanuNaW16yEcFm/H4k+stzqyGhKL48WcG5aJ M3SmVKuCl8rj4i+aNHsXCyYUptXFApgUFWRM8c8jlg5jfqbzZmYz5GMlo3nmWY+W78zA d7/wS+LOkW+Xp7+X0dZJdD1IL1h+hgGHNpl492DQCUqQxxgxIetp6DsT2YA/x0D+aYc9 nOhvDxcWJnHXpppVAE/5AJSbIuOOLH8Uh+NbhcUXrz/Bjm3z0XXHQnzpkbBbsVBLFFMF r7Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=D2QFQyDb; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id d1si7468016pgc.714.2017.09.27.06.20.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Sep 2017 06:20:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=D2QFQyDb; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6D6A96E244; Wed, 27 Sep 2017 13:20:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x22e.google.com (mail-wr0-x22e.google.com [IPv6:2a00:1450:400c:c0c::22e]) by gabe.freedesktop.org (Postfix) with ESMTPS id B3DE86E244 for ; Wed, 27 Sep 2017 13:20:21 +0000 (UTC) Received: by mail-wr0-x22e.google.com with SMTP id m18so16416120wrm.2 for ; Wed, 27 Sep 2017 06:20:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=wOE5IuPFMhRBnpCfRDxhJu7RiDV1LwhlDLPvmKenAco=; b=D2QFQyDbANX2RKrYQW+tliHkX1synpaD1iN8F12nYkzgVxZ2KWCU7MCHAR7JaxctoR VVdjeAvYXDO7yKNrd/c2mJWAphT6zbEoyi/3/lTgL9aK93xElA9/VSO0WNGWTE4qJHhW kW9yGMA13uWXCNtNagj6NCZSTA8CkCJbGL3Xc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=wOE5IuPFMhRBnpCfRDxhJu7RiDV1LwhlDLPvmKenAco=; b=W/+5oh57YWdbL+34eC2G1esQC4oL1xUrfNfRF74w46gCU4aNF+nvpMCOydNBYqQ6So XFdcTxMI0dMmixtIw1Lk1lunuE4SklhXvukYFx3nDsvrv4U1X2eq2e1687ZHOsnmde4F sLVrWJdShdv+v7CL0ImyGpHARv6yO4CpeMWeemHY3xMgHwEC3Uy1RXqdvrxhojEym0Sg TgY7h+cWXwhSfzJwnz6l/HSI/vzOY45PnmeOmc43laLeY6i2cU05+Yb6N1gmEtrOYB0d ZZ/xJ+eZ/KTMXryz8LhRU7eV6NRyn6u37VqK5Ws+pEFusyIrq9QL196ZCk74nx/nCHCe Cpeg== X-Gm-Message-State: AHPjjUjcqHEskDVfixBq0dUwS581btjAnCfJB3kbVFC2vNn3LGj1U2rW YGdFn7W64OgvsREFYKskNQ8RkOgfvQA= X-Google-Smtp-Source: AOwi7QBsk6DIq+5S7S0EctlXw1tRSwvXM3YsWhTycDwfG2t3UjG548cRNbx5U25H2hC7ccWYdHQUJQ== X-Received: by 10.223.160.136 with SMTP id m8mr1580586wrm.70.1506518420223; Wed, 27 Sep 2017 06:20:20 -0700 (PDT) Received: from lmecxl0911.lme.st.com ([80.215.129.76]) by smtp.gmail.com with ESMTPSA id 110sm6886002wra.39.2017.09.27.06.20.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 Sep 2017 06:20:19 -0700 (PDT) From: Benjamin Gaignard To: labbott@redhat.com, sumit.semwal@linaro.org, gregkh@linuxfoundation.org, arve@android.com, riandrews@android.com, broonie@kernel.org, dan.carpenter@oracle.com Subject: [PATCH v5 0/2] staging: ion: get one device per heap Date: Wed, 27 Sep 2017 15:20:07 +0200 Message-Id: <1506518409-16887-1-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 2.7.4 Cc: devel@driverdev.osuosl.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" version 5: - create a configuration flag to keep legacy Ion misc device version 4: - add a configuration flag to switch between legacy Ion misc device and one device per heap version. This change has been suggested after Laura talks at XDC 2017. version 3: - change ion_device_add_heap prototype to return a possible error. version 2: - simplify ioctl check like propose by Dan - make sure that we don't register more than ION_DEV_MAX heaps. Until now all ion heaps are addressing using the same device "/dev/ion". This way of working doesn't allow to give access rights (for example with SElinux rules) per heap. This series propose to have one device "/dev/ionX" per heap. Query heaps informations will be possible on each device node but allocation request will only be possible if heap_mask_id match with device minor number. Using legacy Ion misc device is still by setting ION_LEGACY_DEVICE_API configuration flag. Benjamin Gaignard (2): staging: ion: simplify ioctl args checking function staging: ion: create one device entry per heap drivers/staging/android/TODO | 1 - drivers/staging/android/ion/Kconfig | 7 +++++++ drivers/staging/android/ion/ion-ioctl.c | 29 +++++++++++++++++++++-------- drivers/staging/android/ion/ion.c | 31 ++++++++++++++++++++++++++++++- drivers/staging/android/ion/ion.h | 15 +++++++++++++-- 5 files changed, 71 insertions(+), 12 deletions(-) Acked-by: Laura Abbott