Message ID | 20220906140117.409852-2-michal.winiarski@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <dri-devel-bounces@lists.freedesktop.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 5B580C6FA83 for <dri-devel@archiver.kernel.org>; Tue, 6 Sep 2022 14:02:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D027110E6AB; Tue, 6 Sep 2022 14:02:20 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8C0F310E691 for <dri-devel@lists.freedesktop.org>; Tue, 6 Sep 2022 14:02:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662472931; x=1694008931; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=XPnExotcUv23Qjv9TfC7epqAhRejORbaVej69uQ1Tlk=; b=EoqvKcrAgL1LtW03oYabxItcj7XJywNJXKK8taonOeYkSM/hK9+ldnWw JMVPRShfTPq8wFjJBmtzu1qPrfvcFvPymOzLrfyX4VERExh15wjSjof1u /uIV3T/nDa5ulodo363a2t83T/NdzWJojouQ+zl2oEsejjeuAWEEUyKTj OZp1Cve332dQ0jjwBxaAOncquQp9DqGR/xt9wskCnq5Xgw5Ie6cixz0o1 lO5ziBDkjcW9L5NpLvFb9pCy4L2V/vU2LOkI7omJI1v+2CZmvv4guI9AY VmwG/HIqO+GBk0kN+HOucAkn9ND4GPJj3gY1mmWu5+xYjxGFnpJu/8Oyt A==; X-IronPort-AV: E=McAfee;i="6500,9779,10462"; a="283594486" X-IronPort-AV: E=Sophos;i="5.93,294,1654585200"; d="scan'208";a="283594486" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2022 07:02:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,294,1654585200"; d="scan'208";a="565102150" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga003.jf.intel.com with ESMTP; 06 Sep 2022 07:02:00 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 6 Sep 2022 07:02:00 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 6 Sep 2022 07:01:59 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Tue, 6 Sep 2022 07:01:59 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.171) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Tue, 6 Sep 2022 07:01:53 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fVRDZEe0jgg3XqOBHo6RJEItlmVBgOrra0m+KJ9cUKrODD1KpdzpDHk+dGtfKCoZKZI7Bg6oKlW1ooX0ctMnIBnicsx4Gyjq3xvuCwvq+DT6g8IxQGcKDq9O5h7B9fVJwSn0TPCdFNdrvWAVSCAs3wwClsaTBN3G6OgT+eqepaUoQp4IWOZoUjlOr/mgOxbPGjJvCCMb9WkET4tsWcPMnya81xNbGZdELZLaLrkH0dkf8UlpXmR5bKhcKBaeM3c1fw7GXgz5csB6TyW/PxcgKRfiOtDwSKpbxyXizM1hr7Ywglp4tM6e9Sw0jjmqUYdmmBO+tTqT0JNHuY2vHxDKbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2pMg5E5jFzj3KtV8JUOOv7nChVtQDlBkI0eK1JX+5tY=; b=NAEhvsHZ4+Dw2n8J6dX+kjCRo2ZSMMME+KtdoISt99MyyyaP0+lxrI1gMhhuqYtMcHEpH1Ny/MHXCVOGySTLWrgb+m2yIXp9srJoDbSsfzDu7x7Hy3Cx9RzPJNcQLeT3pexy/pHIG322h471iPuQ4pqHc86pj5pwg1XKxnfRjyufoiDmBiigHvLjl2BN+XsqwEBJoCcmh97z4D5s8rv1LR67f44RjHEbwuzkIWPE1NGPsAoleTCJHHAk/VxCsfTgEp4HLGu+gClmF6zuhLkEaigJINqu158c0+FhMjcmzpnHmx+Pw0RHQNjhXnpsJ2qpoTDZfWuJLrSa/yQQ4pGZqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) by BN7PR11MB2804.namprd11.prod.outlook.com (2603:10b6:406:ac::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.12; Tue, 6 Sep 2022 14:01:52 +0000 Received: from DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::b04c:807c:4ea0:c62e]) by DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::b04c:807c:4ea0:c62e%9]) with mapi id 15.20.5588.018; Tue, 6 Sep 2022 14:01:52 +0000 From: =?utf-8?q?Micha=C5=82_Winiarski?= <michal.winiarski@intel.com> To: <dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org> Subject: [PATCH v3 1/4] drm: Expand max DRM device number to full MINORBITS Date: Tue, 6 Sep 2022 16:01:14 +0200 Message-ID: <20220906140117.409852-2-michal.winiarski@intel.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220906140117.409852-1-michal.winiarski@intel.com> References: <20220906140117.409852-1-michal.winiarski@intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-ClientProxiedBy: FR3P281CA0020.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::21) To DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 422db91c-3acb-4ce1-f6aa-08da901059be X-MS-TrafficTypeDiagnostic: BN7PR11MB2804:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ijp6rj9xduN8Q6wRj/ESes6t5Y+aFyZHTlamW0UpmFQmvw+Ez8W0h7IbQYICYdLHugDNRqJ+DfNEmB9bXVB1t3O8nnF/YApMnS8nJhP7Rbf5b8A3RjY/Iv6EaoVrVM1h2ta6IBCJkgHEJbz9tSeVqbHBFnmqzMk8ZAkcp9rDsoH6BUGlvBhuklGEURxDj7iKE7KMIu+8mOhO21kMl54c1MAcl4dqNJeQus7ucyhHO7pU9yi3ao6fsW1rIgF0a4nZwLhZGrKH3eubPHWXlpJtjhFlLQNc0JGinNZn3wH3oMiBIz2eJx09xH2K6GXb3q3AlJ5TngGNduY4qbMwSGCZEJOOHwMWk+OzxiJQyr6cmGZ1s+6Rxbpp0LOzWgN1rvQyMF5++CND4NzwJoY8nc2k2abM6rmgfFyrv7kMJL8eRyW4lTwPrxXXuYJn/FUCDJiwVQmysrt96SHU33teRf7wHAcQwQC2iAF3lYFzAMfoDN0950i40pIN1Np1lY9Q7Hk57KNx1df3DjHmOEfjrhiaEL9XZIvzNc4zMnYyr1MUqqHnKoLniOkFkqsyrGKDLtrG2W8zcf/EUJh/JHTUsBx7o9bFsxQ6zzW1bOwDIPVntAFRVgtEtoCwCUztgfHFVWzeJOO6URhc0jBzefjr1u8zAoSLd7a0mxdeY4ofiipfpawkDW7LaWY9oqPA44AT+82slIptEG6u5CmmJtTRLI0j4Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5373.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(396003)(39860400002)(376002)(346002)(366004)(136003)(8676002)(6486002)(66476007)(83380400001)(66946007)(66556008)(4326008)(478600001)(6506007)(6666004)(26005)(2906002)(6512007)(5660300002)(8936002)(186003)(1076003)(86362001)(2616005)(41300700001)(36756003)(316002)(82960400001)(38100700002)(54906003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?c1ST5RlUjKkAxlCybl22na76/wPI?= =?utf-8?q?6RDYh04Zbli6cpu75vuj1AiJnU08LI6uCfV3wvWoWKIfU8J6tQ7s0mBwGUVVYb1Lv?= =?utf-8?q?G+rUsq3/kZV+Y6A9ILL3xRd6JaDXBJOLKwTCtYuPCx0tYTJiZr3mawR7LM4r7IRVi?= =?utf-8?q?4e4h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RF+FekkSLPuEnTyHu5UYj/bsa4KepmGn7J+Efh8xlO1Qw8WDJ+B8nh9NplzoG?= =?utf-8?q?FJ1BfycpTcjfAbQRdhu6QUOfQ/8RtAmZ2CY4/KYGmKiFK3HDaZXLoNapRTI3tVI9j?= =?utf-8?q?46wMdQzeJv63DtJiadMwn8Uv0tjpGgtkA5EmWppLT2rMkx6Jm0DK10ayKU9JS9D4/?= =?utf-8?q?0mjWMguX0LTvkXmmIYS+oIPNdW/iInN/TjYhoiJ8fgP6RE2ezt/4Yu6j5doFFkGJw?= =?utf-8?q?cKmhz2oF1MsGacQ4TAn2Yq5MmIHBlkRTN1qzydNPgUGzuygY36RbfRZBWYtrbHVqI?= =?utf-8?q?T+foOyGh2VP3o+UDqm8YS4q1OwT6D0r3gQuxMvfHtqSZPaMcZhKTCHffjQ5JFDyB8?= =?utf-8?q?ctP+F2Uv5kCBdnVTMzY15+H5Vj/Epdxe+lu+QKRe6QxPJaER7WBYRCTniGqjai/iW?= =?utf-8?q?yJmoUfkuAB+nh3b/4k+yhOwvDmU+CySOC2DQD6mZEElKc9r2UCUlRqtqQZk3w6R/9?= =?utf-8?q?q7yjXSX+IyJbRMO8JtN7VKKx+G7tYHrAog=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 422db91c-3acb-4ce1-f6aa-08da901059be X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5373.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2022 14:01:52.7002 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Wl6KVK08Ph4uwT352Ob+KiaJs33PlK1GCFeqklP0oV03MWwPcZ6xlk946uPqY3NyYVtSixh7dEk3hKvncyJ/oFZ7gVczuu2VtcF8QuZQgCs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR11MB2804 X-OriginatorOrg: intel.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development <dri-devel.lists.freedesktop.org> List-Unsubscribe: <https://lists.freedesktop.org/mailman/options/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=unsubscribe> List-Archive: <https://lists.freedesktop.org/archives/dri-devel> List-Post: <mailto:dri-devel@lists.freedesktop.org> List-Help: <mailto:dri-devel-request@lists.freedesktop.org?subject=help> List-Subscribe: <https://lists.freedesktop.org/mailman/listinfo/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=subscribe> Cc: =?utf-8?q?Micha=C5=82_Winiarski?= <michal.winiarski@intel.com>, David Airlie <airlied@linux.ie>, Matthew Wilcox <willy@infradead.org>, Thomas Zimmermann <tzimmermann@suse.de> Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" <dri-devel-bounces@lists.freedesktop.org> |
Series |
drm: Use full allocated minor range for DRM
|
expand
|
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 8214a0b1ab7f..9432b1619602 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -122,6 +122,12 @@ static int drm_minor_alloc(struct drm_device *dev, unsigned int type) minor->type = type; minor->dev = dev; + /* + * DRM used to support 64 devices, for backwards compatibility we need to maintain the + * minor allocation scheme where minors 0-63 are primary nodes, 64-127 are control nodes, + * and 128-191 are render nodes. + * After reaching the limit, we're allocating minors dynamically - first-come, first-serve. + */ idr_preload(GFP_KERNEL); spin_lock_irqsave(&drm_minor_lock, flags); r = idr_alloc(&drm_minors_idr, @@ -129,6 +135,8 @@ static int drm_minor_alloc(struct drm_device *dev, unsigned int type) 64 * type, 64 * (type + 1), GFP_NOWAIT); + if (r == -ENOSPC) + r = idr_alloc(&drm_minors_idr, NULL, 192, 1 << MINORBITS, GFP_NOWAIT); spin_unlock_irqrestore(&drm_minor_lock, flags); idr_preload_end();
Having a limit of 64 DRM devices is not good enough for modern world where we have multi-GPU servers, SR-IOV virtual functions and virtual devices used for testing. Let's utilize full minor range for DRM devices. To avoid regressing the existing userspace, we're still maintaining the numbering scheme where 0-63 is used for primary, 64-127 is reserved (formerly for control) and 128-191 is used for render. For minors >= 192, we're allocating minors dynamically on a first-come, first-served basis. Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> --- drivers/gpu/drm/drm_drv.c | 8 ++++++++ 1 file changed, 8 insertions(+)