Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp8436501rwp; Wed, 19 Jul 2023 09:44:55 -0700 (PDT) X-Google-Smtp-Source: APBJJlHZfwjvT3wTXjIVlujAa2bjNAw3ZQLkHxvhSK6SUCLqMnzME3gq6ex+WRNvjM0tviowMMPz X-Received: by 2002:aa7:c999:0:b0:51d:914a:9f43 with SMTP id c25-20020aa7c999000000b0051d914a9f43mr3167142edt.36.1689785095465; Wed, 19 Jul 2023 09:44:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689785095; cv=none; d=google.com; s=arc-20160816; b=q3vWWiOES+RgDHU7Ucmy49mvxYEXbWU04epKRvHSOrU3cO1W+ytN9YSSM1JTU034HT YTv3Insb6b3WSnfb8WpjnEHKKxsY0CzOJ7HCM6JEJs/b/YTAbcJSR4puKY7HO8oJG4Zl 6z5NVVdRcIWiC8Ze3k/RTsVuKL0YHgFlFfL+ix3gj4kAiibUcoKKUZV1Phv09YsM2CCW tLS851PvSiPvL02LhPy6mqJ//R/H2J+Fra1xOd92TWKZ2E+VFuuOeO5rhQWgRzOSff4x 7rwov6OCI2g23Y/N9WBZg9z1qKwsrYcsR4X32+7nGd3CuwgAEhtxpeYitwjMROvlfVv2 T6yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=55EPq0g7zYDKNZ7W/H6b+HqiWJWsszgyJDgB0V4aX1M=; fh=dxIo+wp2Pw2j7LKHXvog8zBrh2HlBFjJ3CkiHF3U0aM=; b=oSAF/tNXGQ+L/R0EG8gQ7UEguz1Q+IbJY1BuIKXmZIezzjqV+pnE+xkFr3fP+gDbbY 7p4r59HaNPYVd7F7+9Qn9bMg3XAq0fUfpHkbXGXIf+gccvzGC9wzdg2K6fuQEo8jyDPo mEXxH/UPJah3wGT/+RvgL38hDH+3a//K4UiWBGPi68LSSmIx/oQFfsGvtd4eB6RupaFc oSLLZgh/XprukXXuJbq5tbNLKM4ajUUiDd5YVysIjoe+Mk5yWfDaGXmdNJS/f8hN+B7/ 7ZVG70GnKh+IjrZqz+mxPnyZA6E/qOb2pYjQQh0+tzP9f4tQA1okWAO7SHiMb3FiKG5T xYeQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y19-20020a056402135300b0051e0709a710si3302759edw.634.2023.07.19.09.44.30; Wed, 19 Jul 2023 09:44:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230022AbjGSQlx (ORCPT + 99 others); Wed, 19 Jul 2023 12:41:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbjGSQlu (ORCPT ); Wed, 19 Jul 2023 12:41:50 -0400 Received: from mblankhorst.nl (lankhorst.se [141.105.120.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DF7D135 for ; Wed, 19 Jul 2023 09:41:49 -0700 (PDT) From: Maarten Lankhorst To: alsa-devel@alsa-project.org Cc: sound-open-firmware@alsa-project.org, linux-kernel@vger.kernel.org, Maarten Lankhorst , Jaroslav Kysela , Takashi Iwai , Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Mark Brown , Daniel Baluta Subject: [PATCH v2 2/9] ALSA: hda/i915: Allow override of gpu binding. Date: Wed, 19 Jul 2023 18:41:34 +0200 Message-Id: <20230719164141.228073-3-maarten.lankhorst@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230719164141.228073-1-maarten.lankhorst@linux.intel.com> References: <20230719164141.228073-1-maarten.lankhorst@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Selecting CONFIG_DRM selects CONFIG_VIDEO_NOMODESET, which exports video_firmware_drivers_only(). This can be used as a first approximation on whether i915 will be available. It's safe to use as this is only built when CONFIG_SND_HDA_I915 is selected by CONFIG_I915. It's not completely fool proof, as you can boot with "nomodeset i915.modeset=1" to make i915 load regardless, or use "i915.force_probe=!*" to never load i915, but the common case of booting with nomodeset to disable all GPU drivers this will work as intended. Because of this, we add an extra module parameter, snd_hda_core.gpu_bind that can be used to signal users intent. -1 follows nomodeset, 0 disables binding, 1 forces wait/-EPROBE_DEFER on binding. Signed-off-by: Maarten Lankhorst --- sound/hda/hdac_i915.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sound/hda/hdac_i915.c b/sound/hda/hdac_i915.c index 161a9711cd63e..c32709fa4115f 100644 --- a/sound/hda/hdac_i915.c +++ b/sound/hda/hdac_i915.c @@ -11,6 +11,13 @@ #include #include +#include