[Intel-xe] [PATCH] drm/xe/xe_uc_fw: Use firmware files from standard locations

Lucas De Marchi lucas.demarchi at intel.com
Wed Mar 15 17:39:44 UTC 2023


On Wed, Mar 15, 2023 at 10:14:24AM -0700, Lucas De Marchi wrote:
>On Wed, Mar 15, 2023 at 07:11:45AM +0100, Mauro Carvalho Chehab wrote:
>>On Fri, 10 Mar 2023 09:13:39 +0100
>>Mauro Carvalho Chehab <mauro.chehab at linux.intel.com> wrote:
>>
>>>From: Mauro Carvalho Chehab <mchehab at kernel.org>
>>>
>>>The GuC/HuC firmware files used by Xe drivers are the same as
>>>used by i915. Use the already-known location to find those
>>>firmware files, for a couple of reasons:
>>>
>>>1. Avoid having the same firmware placed on two different
>>>   places on MODULE_FIRMWARE(), if both 915 and xe drivers
>>>   are compiled;
>>>
>>>2. Having firmware files located on different locations may end
>>>   creating bigger initramfs, as the same files will be copied
>>>   twice my mkinitrd/dracut/...;
>>
>>Heh, it turns that it may not even be placing the firmware at the right
>>place, if someone does a symlink for /lib/firmware/xe pointing to
>>/lib/firmware/i915 (or vice versa), depending on what's implemented
>>at the mkinitrd logic.
>>
>>I found this on /usr/share/initramfs-tools/hook-functions:
>>
>>        # We don't need to replicate a chain of links completely;
>>        # just link directly to the ultimate target
>>        link_target="$(readlink -f "${src}")" || return $(($? + 1))
>>
>>So, basically, using Ubuntu's default mkinitrd package, if
>>/lib/firmware/xe is a symlink, instead of storing
>>/lib/firmware/xe/bxt_dmc_ver1_07.bin, it will actually store
>>/lib/firmware/i915/bxt_dmc_ver1_07.bin at the initramfs, which
>>will cause crashes if the Xe driver is not blacklisted.
>
>storing /lib/firmware/i915/bxt_dmc_ver1_07.bin in the initramfs is
>actually the correct thing to do as this is what our module is currently
>asking for:
>
>	$ modinfo -F firmware build64/drivers/gpu/drm/xe/xe.ko
>	xe/tgl_huc_7.9.3.bin
>	xe/dg1_huc_7.9.3.bin
>	xe/tgl_guc_70.bin
>	xe/dg1_guc_70.bin
>	xe/dg2_guc_70.bin
>	xe/pvc_guc_70.bin
>	xe/tgl_guc_70.bin
>	xe/adlp_guc_70.bin
>	xe/mtl_guc_70.bin
>	i915/bxt_dmc_ver1_07.bin
>	i915/skl_dmc_ver1_27.bin
>	i915/kbl_dmc_ver1_04.bin
>	i915/glk_dmc_ver1_04.bin
>	i915/icl_dmc_ver1_09.bin
>	i915/tgl_dmc_ver2_12.bin
>	i915/rkl_dmc_ver2_03.bin
>	i915/dg1_dmc_ver2_02.bin
>	i915/adls_dmc_ver2_01.bin
>	i915/adlp_dmc_ver2_16.bin
>	i915/dg2_dmc_ver2_08.bin
>
>And i915 is also using those dmc files.
>Note that for this item here, the duplicate firmware blobs (if you also
>have i915 built) are the guc/huc ones, not DMC.
>
>I still agree with the change here as it's expected these old platforms
>are primarily supported by the i915 driver and we don't need the
>firmware files to be in an xe directory.


I added a note that I don't agree much with the commit message, but
overall agree with what this is doing. Pushed.

Lucas De Marchi


More information about the Intel-xe mailing list