From patchwork Sun Sep 11 21:14:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Micha=C5=82_Winiarski?= X-Patchwork-Id: 12973072 Return-Path: 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 7BEA5C6FA86 for ; Sun, 11 Sep 2022 21:17:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ED19810E536; Sun, 11 Sep 2022 21:17:35 +0000 (UTC) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id DD5F910E531; Sun, 11 Sep 2022 21:17:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662931050; x=1694467050; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=Eni6pit1misnqHqlJtjektfnPpxUovniHQMbrNEZkCI=; b=N9BxYJGCDHslRznkl9fgaPH/9TsMfsmAprW0Hoe/Fp9RhJDptA0VTJPM B1E+UhvSkUXI+bsph7tRM4+3HFW50s1WRjbwDW2vPuCDooMQxjfNKrQA6 psDMT6chGkRJ8PQMsp/xxJKihsOBH+LiqXG6C2hgF3/Oi8NUcScIHTJhI YhOPRlR4VBg3HnO33QL90GhtglT87lArNZ3HQKmBgd9tI8aOFWe/yBYlT uztqqjarrirUkEPi763dh+GRlFo2SIOBe8EXhYM8NFeOc1/cGnctbZ7Ym NE0XlkBDlPNtRIY2lSlR4azuI7S+QBkncfU1cgld5u9EwyqB8yvTwswY9 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10467"; a="277487733" X-IronPort-AV: E=Sophos;i="5.93,307,1654585200"; d="scan'208";a="277487733" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2022 14:17:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,307,1654585200"; d="scan'208";a="791356689" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga005.jf.intel.com with ESMTP; 11 Sep 2022 14:17:30 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sun, 11 Sep 2022 14:17:30 -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; Sun, 11 Sep 2022 14:17:29 -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; Sun, 11 Sep 2022 14:17:29 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.169) 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; Sun, 11 Sep 2022 14:17:29 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=exgtPUFVWCBaRTKnXWxN3Z0W7nCfMxdlxnYATJ/5H/2zNr1p/U0qn04P2GZ61tuo5HbHp3DyV7jczwhaMT83GQoxCEZ0o3yTPvqgxEWnzBc7Ay87jVHIAGqNh+XnojUMNun53xRqwj3y3+aYf/8NsTdvFGMFnXeVd+z624BOVnmS35jjiO3ysrvTv3Y4h0vvYb4TpeLTU3Q2mgKfByh2FfhdE0eMcbDFuuvt8u9lqaTaD5mWITdGlz6NZum/BY9USmlfsJGROLwWrtTuaMyVw4kRTIIGCtU0OiRTZqEfMecM3PXIS2p2d3mhvTfC+tIon1uUZEwocHt2/a2w+so9Ow== 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=BURZsTUp8t4+hgi3/wRuiapcI4tA1G2tUY+fOYCxK7w=; b=fvASL/vE52tLMvfVGpi41mAO8Ly4w5BrNAo1lW8FW2FG1U8T7p2uYmkqWQPCWM7LLR8IXcNlvXYizafFD55Kg2ZMQiPRXnY+khwchFJKeA7Su9uD5UtbrF7TD3lTlCvJHN8sSvsDcYgtU9gAmtWmXDC787amtpqyeVbG6E5myQ3vj7LPzp1KyPIFrjUaozgGx9JF6HFRLHhK1BAUu9LFG8clKgSoREoib6qKMvIwnNvsHH4QFx7F3fBdl0GxzQze0lZlwlVVU3KLDaGdvkjEjGxTNxNXXCb3WG9Au9kl6eUnecj3OdEw53tsTUqyuS8h2yfr0B7uVbzyAP8s5CGULg== 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 DM4PR11MB6065.namprd11.prod.outlook.com (2603:10b6:8:60::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.20; Sun, 11 Sep 2022 21:17:23 +0000 Received: from DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::5145:64b6:db32:b424]) by DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::5145:64b6:db32:b424%5]) with mapi id 15.20.5612.022; Sun, 11 Sep 2022 21:17:23 +0000 From: =?utf-8?q?Micha=C5=82_Winiarski?= To: , , Date: Sun, 11 Sep 2022 23:14:43 +0200 Message-ID: <20220911211443.581481-4-michal.winiarski@intel.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220911211443.581481-1-michal.winiarski@intel.com> References: <20220911211443.581481-1-michal.winiarski@intel.com> X-ClientProxiedBy: FR3P281CA0111.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a3::14) To DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB5373:EE_|DM4PR11MB6065:EE_ X-MS-Office365-Filtering-Correlation-Id: 10a2f41a-644d-4cb3-4a88-08da943b04a9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1ufxRGNyPea//rp/OTtiLb2TfdPosKT8gGX7yeSKabRKJD9V/ishLR12w1sBck2FqpWefKddwbHEzDYrty7HN4beOUd38gMkae3HlTIlxICnawSJHnfVSB6MpoWsOzqWjTGbjs7xQKRDBLBuKH2k2vqMfHA2EDtelks+myVtn2zalDQNDrRuDwhFIbFVODqvuGDHEBXVA4VLtWZsbOMXfiilGNeOy7wg35jWE4Dr2f9slfsf02J6/9yc5o8DKjuYe/o+6weqy/rP5Z0SyFqPfXq9kKtC6FPtgtogAfKWTrTSWZn8MkxXY2XxJlGh1IUaX2u6dCoygX6546Os5vKPfKyxLej1tLwJ7q1ttC6IIBs/sAhrDCkmx/Zgw0F2B+tlG69Pp4X/7bEr/Lq+DXCD9gx5bO5TILxDorU2boa3hiQNM6O1OKAfj+Zq+2+bsPDJwyG8QRwJhtva+9YX4Pxxc+6yhLoChemwAxl3ywgscZ2GgtNuXcVpuwQfaouAl6yhCIsAAd4wNTgxoItOm6JSdzOOqjQmlUdXsdp0mUwMwUJW/b3iUcw8ibc/+smt4JOYyelOUSDQ5yVYijCaPTUuomfCp2alDsEgKMJdG3UGk3yb7uYRQ6PzOircekW21P34uxXu8Fp4nwz8dH26OXe3fzKfeMyOh+xtSqa60Iep1o6IbvGHLjEzpTRisabhA9qNrprN95qyovBQVmf30cqzYg== 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)(346002)(366004)(396003)(136003)(376002)(39860400002)(186003)(6512007)(26005)(41300700001)(6506007)(83380400001)(6486002)(1076003)(478600001)(2616005)(6666004)(316002)(4326008)(8936002)(8676002)(7416002)(2906002)(82960400001)(5660300002)(38100700002)(86362001)(66556008)(66476007)(54906003)(66946007)(36756003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?lVnjA2doM7EavXUv1PYDkwe3mest?= =?utf-8?q?aQAbmT31+rpCpSTgHX1VjrITZv/uK4QQEleWfDGtmcGS0glsGFKjZGAcJFtaABv5u?= =?utf-8?q?2ZuVut/R2H/ObZJlSzTyIgVmR5USeIAnLyA0uNbLJnZdYOK5h/62Y2vdh2Kk0cyRD?= =?utf-8?q?ZlI6p5jq1QbhqfUaIJyo9Z9VjJZkqy8vrSfjA4aKi0I+vt8Hk874ifEQ59OzvmSJG?= =?utf-8?q?oIbgVr6Ed9d3Ul5uQ/vbBwqS6HamnrBLqyVwSa1S8qJOJm8dJKtY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qYwy?= =?utf-8?q?/q/e3YS7H4VJN2bThJa2chppidPb729L+crD558qDx5MakAJZlxMlyVEvI3olHDha?= =?utf-8?q?dai2J32HfE+rufnsa8Zm3jA6NvhVLmEJQ5hpJ14Hk2ywHLIG0um0r3+0HCb7fQ2kV?= =?utf-8?q?FLsTTc56ldQR6itCCGzZYzOMiDP28s9X8R4lrmuaN2W6Q2Q/R4VEUdl2ciwLhD8EO?= =?utf-8?q?TxZ/aLEXyBt4leNwDA/uXM2BjWZYO9+L27qv6a7OblkaHcV7hPnTQrO8GdzX/2tqC?= =?utf-8?q?FInAFAi9q9s6Pk8DlQvRQACWfexXrF8XFW0Ae9vKKQ85XtCGc9XM/eLPiZowFpq0H?= =?utf-8?q?VU6JbobnEdkRtRw/Phl84UZNcu2PnMenErskKxofSWpJT0m8CZM7O69b6/NMh4jOX?= =?utf-8?q?wKXv4O/tfGnxJ4hpZNTMTJSDwd1ZSxaywA=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 10a2f41a-644d-4cb3-4a88-08da943b04a9 X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5373.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2022 21:17:22.9468 (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: tOXhJsMdUogiZMFfGmOlcPou/Nen73LTq+OSbEpGcWyP7Mgl9a2J/VUa3K6yPt0zGkWU6XcLjtrMt/x9Ral/DRrW76k7VTjbebrB4mXUPYc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB6065 X-OriginatorOrg: intel.com Subject: [Intel-gfx] [PATCH v5 3/3] drm: Introduce skip_legacy_minors modparam X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Micha=C5=82_Winiarski?= , Daniel Vetter , David Airlie , Simon Ser , Maxime Ripard , Matthew Wilcox , Thomas Zimmermann Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" While there is support for >64 DRM devices on kernel side, existing userspace may still have some hardcoded assumptions and it's possible that it will require changes to be able to use more than 64 devices. Add a modparam to simplify testing and development of >64 devices support on userspace side by allocating minors from the >=192 range (without the need of having >64 physical devices connected). Signed-off-by: MichaƂ Winiarski --- drivers/gpu/drm/drm_drv.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 3718bd6bbef6..368408997fed 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -56,6 +56,11 @@ MODULE_LICENSE("GPL and additional rights"); static DEFINE_XARRAY_ALLOC(drm_minors_xa); +static bool skip_legacy_minors; +module_param_unsafe(skip_legacy_minors, bool, 0400); +MODULE_PARM_DESC(skip_legacy_minors, + "Don't allocate minors in 0-192 range. This can be used for testing userspace support for >64 drm devices (default: false)"); + /* * If the drm core fails to init for whatever reason, * we should prevent any drivers from registering with it. @@ -112,7 +117,7 @@ static void drm_minor_alloc_release(struct drm_device *dev, void *data) static int drm_minor_alloc(struct drm_device *dev, unsigned int type) { struct drm_minor *minor; - int r; + int r = -EBUSY; minor = drmm_kzalloc(dev, sizeof(*minor), GFP_KERNEL); if (!minor) @@ -127,7 +132,8 @@ static int drm_minor_alloc(struct drm_device *dev, unsigned int type) * and 128-191 are render nodes. * After reaching the limit, we're allocating minors dynamically - first-come, first-serve. */ - r = xa_alloc(&drm_minors_xa, &minor->index, NULL, DRM_LEGACY_MINOR_LIMIT(type), GFP_KERNEL); + if (!skip_legacy_minors) + r = xa_alloc(&drm_minors_xa, &minor->index, NULL, DRM_LEGACY_MINOR_LIMIT(type), GFP_KERNEL); if (r == -EBUSY) r = xa_alloc(&drm_minors_xa, &minor->index, NULL, DRM_MINOR_LIMIT, GFP_KERNEL); if (r < 0)