From 8daebf3f57e4b0abc52647c4abba781e88736c74 Mon Sep 17 00:00:00 2001 From: jsg Date: Fri, 9 Aug 2024 11:04:07 +0000 Subject: [PATCH] enable GuC authentication of HuC The HEVC/H.265 micro Controller (HuC) requires authentication via the Graphics micro Controller (GuC) on pre DG2/MTL hardware. HuC is required for Low Power Encoding with the Intel Media Driver for VAAPI. Using GuC for command submission caused memory corruption on DG2 and inconsistent errors on boot with Alder Lake, so GuC was previously disabled entirely in a local change. initial diff from and tested by rsadowski@ (on Alder Lake) --- sys/dev/pci/drm/i915/i915_driver.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/i915/i915_driver.c b/sys/dev/pci/drm/i915/i915_driver.c index 8ba7b3f12fb..df45f227f22 100644 --- a/sys/dev/pci/drm/i915/i915_driver.c +++ b/sys/dev/pci/drm/i915/i915_driver.c @@ -2301,13 +2301,18 @@ inteldrm_attach(struct device *parent, struct device *self, void *aux) /* Device parameters start as a copy of module parameters. */ i915_params_copy(&dev_priv->params, &i915_modparams); - dev_priv->params.enable_guc = 0; dev_priv->params.request_timeout_ms = 0; dev_priv->params.enable_psr = 0; /* Set up device info and initial runtime info. */ intel_device_info_driver_create(dev_priv, dev->pdev->device, info); + /* uc_expand_default_options() with no GuC submission */ + if (GRAPHICS_VER(dev_priv) >= 12 && + !IS_TIGERLAKE(dev_priv) && !IS_ROCKETLAKE(dev_priv) && + !IS_XEHPSDV(dev_priv) && !IS_PONTEVECCHIO(dev_priv)) + dev_priv->params.enable_guc = ENABLE_GUC_LOAD_HUC; + mmio_bar = (GRAPHICS_VER(dev_priv) == 2) ? 0x14 : 0x10; /* from intel_uncore_setup_mmio() */ -- 2.20.1