Page MenuHomeFreeBSD

GPU firmware: Load i915 and amdgpu firmware failed.
Needs ReviewPublic

Authored by vico.chern_qq.com on Sep 5 2023, 10:58 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 13, 5:12 PM
Unknown Object (File)
Wed, Nov 13, 5:11 PM
Unknown Object (File)
Wed, Nov 13, 4:50 PM
Unknown Object (File)
Wed, Nov 13, 3:58 PM
Unknown Object (File)
Wed, Nov 13, 3:57 PM
Unknown Object (File)
Wed, Nov 13, 6:09 AM
Unknown Object (File)
Wed, Nov 13, 6:08 AM
Unknown Object (File)
Wed, Nov 13, 5:32 AM
This revision needs review, but all reviewers have resigned.

Details

Reviewers
bz
Summary

Description: While load i915 driver (drm 5.15 from github), the GPU firmwares can NOT be loaded due to looking up FW failed. For example, i915 FW name is with format 'i915/glk_dmc_xxx', and the FW image name is with format 'i915_glk_dmc_xxx_bin'. But 'firmware_register' always registers FW with FW name but not FW image name, so 'lookup' FW by FW image name failed.

Solution: always 'lookup' FW by FW name.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

This seems questionable. Isn't the real problem where the firmware modules get created? Has anything changed recently (in Linux or there)? I am sure this will break other drivers.

I don't really understand the problem, firmware loads fine here.

In D41729#951068, @manu wrote:

I don't really understand the problem, firmware loads fine here.

Same here. (Though the firmware does cause my i915 GPU to panic on the rare occasion, but that's a different problem.)

In D41729#951068, @manu wrote:

I don't really understand the problem, firmware loads fine here.

How do you load the firmware?
For my case, if I load firmware manually 'kldload i915_glk_dmc_ver1_04_bin.ko', and then load i915kms.ko, it will work well. But if I only load the i915kms.ko, but let the i915 driver to load the firmware automatically, then the firmware loading will be failed.

In D41729#951025, @bz wrote:

This seems questionable. Isn't the real problem where the firmware modules get created? Has anything changed recently (in Linux or there)? I am sure this will break other drivers.

Let me describe the issue, and take 'i915_glk_dmc_ver1_04_bin.ko' firmware as an example:
The firmware is registered by 'firmware_register' while it is loaded, and the FW is registered to a table by the fw name 'i915/glk_dmc_ver1_04.bin' which is defined by i915 driver.
While the GPU driver requests the FW by trying different names, it will call 'firmware_get_flags' to try different names.
For this case, if I load the firmware manually before loading i915kms.ko, since the firmware is registered with the name ''i915/glk_dmc_ver1_04.bin', while i915kms request FW to lookup it by the name 'i915/glk_dmc_ver1_0.bin', it works well. But if i915kms requests FW, but the FW is NOT loaded, i915kms will load the firmware by trying different names. While firmware_get_flags trys to load ''i915/glk_dmc_ver1_04.bin', it is failed since no such FW kos. While firmware_get_flags trys to load ''i915_glk_dmc_ver1_04_bin', the ko is found, and is loaded and registered by 'firmware_register', but firmware_register registers the FW by the name ''i915/glk_dmc_ver1_04.bin' but not 'i915_glk_dmc_ver1_04_bin', and the 'lookup' finds the FW by ''i915_glk_dmc_ver1_04_bin', so the 'lookup' is failed, and FW loading is failed.

This issue is very easy to be reproduced.

This fix only impacts the 'linuxkpi_request_firmware', if the fw name passed to linuxkpi_request_firmware is the same as the fwname passed to 'firmware_register', then no issue.

In D41729#951068, @manu wrote:

I don't really understand the problem, firmware loads fine here.

How do you load the firmware?
For my case, if I load firmware manually 'kldload i915_glk_dmc_ver1_04_bin.ko', and then load i915kms.ko, it will work well. But if I only load the i915kms.ko, but let the i915 driver to load the firmware automatically, then the firmware loading will be failed.

I don't load the firmware, i915kms do it for me and it should also do it for you, can you share part of dmesg when you load i915kms without this patch ?

Hi All,
My previous version still has issues as the fw looks loaded well but it is unloaded after a while. The reason is: in i915 driver, after 'request_firmware', i915 driver calls 'release_firmware', and it calls 'firmware_put' to decrease reference counter to '0' and if with 'fp->file' value, it triggers the unload task to unload fw. I just upload another version patch to load the fw module in 'firmware_get_flag' instead of fw loaded in 'loadimage' to avoid 'fp->file' set to some value to trigger the unloading task, just like simulating load the fw ko manually and then load the i915kms.

The 'request_firmware' and 'release_firmware' is NOT designed as Linux usage. I am still thinking about if there are better way to comptible Linux usage but don't break current FreeBSD logic.
Welcome any suggestions.

In D41729#951384, @manu wrote:
In D41729#951068, @manu wrote:

I don't really understand the problem, firmware loads fine here.

How do you load the firmware?
For my case, if I load firmware manually 'kldload i915_glk_dmc_ver1_04_bin.ko', and then load i915kms.ko, it will work well. But if I only load the i915kms.ko, but let the i915 driver to load the firmware automatically, then the firmware loading will be failed.

I don't load the firmware, i915kms do it for me and it should also do it for you, can you share part of dmesg when you load i915kms without this patch ?

I suppose you understand what the root cause in my case. And share the dmesg:

Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.822448] iicbus3: <Philips I2C bus> on lkpi_iic1
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.822490] iic3: <I2C generic I/O> on iicbus3
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.822538] lkpi_iic2: <LinuxKPI I2C> on drmn0
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.822571] iicbus4: <Philips I2C bus> on lkpi_iic2
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.822613] iic4: <I2C generic I/O> on iicbus4
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.823367] i915_glk_dmc_ver1_04_bin: firmware image loaded, but did not register
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.823517] drmn0: could not load firmware image 'i915/glk_dmc_ver1_04.bin'
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.823522] drmn0: [drm] Failed to load DMC firmware i915/glk_dmc_ver1_04.bin. Disabling runtime power management.
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.823525] drmn0: [drm] Run pkg install gpu-firmware-kmod to install it

Hi All,
My previous version still has issues as the fw looks loaded well but it is unloaded after a while. The reason is: in i915 driver, after 'request_firmware', i915 driver calls 'release_firmware', and it calls 'firmware_put' to decrease reference counter to '0'

That's the normal operation for i915kms, it loads the firmware, uploads it to the GPU and release it as it's not needed anymore.
https://github.com/freebsd/drm-kmod/blob/master/drivers/gpu/drm/i915/display/intel_dmc.c#L633

and if with 'fp->file' value, it triggers the unload task to unload fw. I just upload another version patch to load the fw module in 'firmware_get_flag' instead of fw loaded in 'loadimage' to avoid 'fp->file' set to some value to trigger the unloading task, just like simulating load the fw ko manually and then load the i915kms.

The 'request_firmware' and 'release_firmware' is NOT designed as Linux usage. I am still thinking about if there are better way to comptible Linux usage but don't break current FreeBSD logic.
Welcome any suggestions.

In D41729#951384, @manu wrote:
In D41729#951068, @manu wrote:

I don't really understand the problem, firmware loads fine here.

How do you load the firmware?
For my case, if I load firmware manually 'kldload i915_glk_dmc_ver1_04_bin.ko', and then load i915kms.ko, it will work well. But if I only load the i915kms.ko, but let the i915 driver to load the firmware automatically, then the firmware loading will be failed.

I don't load the firmware, i915kms do it for me and it should also do it for you, can you share part of dmesg when you load i915kms without this patch ?

I suppose you understand what the root cause in my case. And share the dmesg:

No I really don't, it looks like you have a firmware with that name but that it contains crap data.

Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.822448] iicbus3: <Philips I2C bus> on lkpi_iic1
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.822490] iic3: <I2C generic I/O> on iicbus3
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.822538] lkpi_iic2: <LinuxKPI I2C> on drmn0
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.822571] iicbus4: <Philips I2C bus> on lkpi_iic2
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.822613] iic4: <I2C generic I/O> on iicbus4
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.823367] i915_glk_dmc_ver1_04_bin: firmware image loaded, but did not register
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.823517] drmn0: could not load firmware image 'i915/glk_dmc_ver1_04.bin'
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.823522] drmn0: [drm] Failed to load DMC firmware i915/glk_dmc_ver1_04.bin. Disabling runtime power management.
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.823525] drmn0: [drm] Run pkg install gpu-firmware-kmod to install it

In D41729#951494, @manu wrote:

Hi All,
My previous version still has issues as the fw looks loaded well but it is unloaded after a while. The reason is: in i915 driver, after 'request_firmware', i915 driver calls 'release_firmware', and it calls 'firmware_put' to decrease reference counter to '0'

That's the normal operation for i915kms, it loads the firmware, uploads it to the GPU and release it as it's not needed anymore.
https://github.com/freebsd/drm-kmod/blob/master/drivers/gpu/drm/i915/display/intel_dmc.c#L633

and if with 'fp->file' value, it triggers the unload task to unload fw. I just upload another version patch to load the fw module in 'firmware_get_flag' instead of fw loaded in 'loadimage' to avoid 'fp->file' set to some value to trigger the unloading task, just like simulating load the fw ko manually and then load the i915kms.

The 'request_firmware' and 'release_firmware' is NOT designed as Linux usage. I am still thinking about if there are better way to comptible Linux usage but don't break current FreeBSD logic.
Welcome any suggestions.

In D41729#951501, @manu wrote:
In D41729#951384, @manu wrote:
In D41729#951068, @manu wrote:

I don't really understand the problem, firmware loads fine here.

How do you load the firmware?
For my case, if I load firmware manually 'kldload i915_glk_dmc_ver1_04_bin.ko', and then load i915kms.ko, it will work well. But if I only load the i915kms.ko, but let the i915 driver to load the firmware automatically, then the firmware loading will be failed.

I don't load the firmware, i915kms do it for me and it should also do it for you, can you share part of dmesg when you load i915kms without this patch ?

I suppose you understand what the root cause in my case. And share the dmesg:

No I really don't, it looks like you have a firmware with that name but that it contains crap data.

OK. If you look at the dmesg: '>> Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.823367] i915_glk_dmc_ver1_04_bin: firmware image loaded, but did not register'. Why it reports this error, it is because fw is registered by the name "i915/glk_dmc_ver1_04.bin" while calling 'firmware_register', but the 'lookup' find the fw in table by the name 'i915_glk_dmc_ver1_04_bin', it is failed, so it reports this error.

const struct firmware *
firmware_register(const char *imagename, const void *data, size_t datasize,

unsigned int version, const struct firmware *parent)

{
....................................................................................................
mtx_lock(&firmware_mtx);
if (lookup(imagename) != NULL) {

		/* We lost a race. */
		mtx_unlock(&firmware_mtx);
		free(name, M_FIRMWARE);
		free(frp, M_FIRMWARE);
		return (NULL);

}
frp->fw.name = name;-----------------------------> name is '"i915/glk_dmc_ver1_04.bin", registered to 'firmware_table'.
frp->fw.data = data;
frp->fw.datasize = datasize;
frp->fw.version = version;
if (parent != NULL)

		frp->parent = PRIV_FW(parent);

LIST_INSERT_HEAD(&firmware_table, frp, link);
mtx_unlock(&firmware_mtx);
if (bootverbose)

		printf("firmware: '%s' version %u: %zu bytes loaded at %p\n",
		    imagename, version, datasize, data);

return (&frp->fw);
}

const struct firmware *
firmware_get_flags(const char *imagename, uint32_t flags)
{
............................................................
mtx_lock(&firmware_mtx);
fp = lookup(fwli->imagename);------------------->imagename is 'i915_glk_dmc_ver1_04_bin', so 'lookup' in firmware_table' is failed.
if (fp == NULL || fp->file != NULL) {

		mtx_unlock(&firmware_mtx);
		if (fp == NULL)
			printf("%s: firmware image loaded, "
			    "but did not register\n", fwli->imagename);
		(void) linker_release_module(fwli->imagename, NULL, NULL);
		mtx_lock(&firmware_mtx);
		goto done;

}

Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.822448] iicbus3: <Philips I2C bus> on lkpi_iic1
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.822490] iic3: <I2C generic I/O> on iicbus3
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.822538] lkpi_iic2: <LinuxKPI I2C> on drmn0
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.822571] iicbus4: <Philips I2C bus> on lkpi_iic2
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.822613] iic4: <I2C generic I/O> on iicbus4
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.823367] i915_glk_dmc_ver1_04_bin: firmware image loaded, but did not register
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.823517] drmn0: could not load firmware image 'i915/glk_dmc_ver1_04.bin'
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.823522] drmn0: [drm] Failed to load DMC firmware i915/glk_dmc_ver1_04.bin. Disabling runtime power management.
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.823525] drmn0: [drm] Run pkg install gpu-firmware-kmod to install it

No I really don't, it looks like you have a firmware with that name but that it contains crap data.

OK. If you look at the dmesg: '>> Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.823367] i915_glk_dmc_ver1_04_bin: firmware image loaded, but did not register'. Why it reports this error, it is because fw is registered by the name "i915/glk_dmc_ver1_04.bin" while calling 'firmware_register', but the 'lookup' find the fw in table by the name 'i915_glk_dmc_ver1_04_bin', it is failed, so it reports this error.

If that's the error it would happend with all the firmwares that we provide, so I don't think that what you're saying is true.

const struct firmware *
firmware_register(const char *imagename, const void *data, size_t datasize,

unsigned int version, const struct firmware *parent)

{
....................................................................................................
mtx_lock(&firmware_mtx);
if (lookup(imagename) != NULL) {

		/* We lost a race. */
		mtx_unlock(&firmware_mtx);
		free(name, M_FIRMWARE);
		free(frp, M_FIRMWARE);
		return (NULL);

}
frp->fw.name = name;-----------------------------> name is '"i915/glk_dmc_ver1_04.bin", registered to 'firmware_table'.
frp->fw.data = data;
frp->fw.datasize = datasize;
frp->fw.version = version;
if (parent != NULL)

		frp->parent = PRIV_FW(parent);

LIST_INSERT_HEAD(&firmware_table, frp, link);
mtx_unlock(&firmware_mtx);
if (bootverbose)

		printf("firmware: '%s' version %u: %zu bytes loaded at %p\n",
		    imagename, version, datasize, data);

return (&frp->fw);
}

const struct firmware *
firmware_get_flags(const char *imagename, uint32_t flags)
{
............................................................
mtx_lock(&firmware_mtx);
fp = lookup(fwli->imagename);------------------->imagename is 'i915_glk_dmc_ver1_04_bin', so 'lookup' in firmware_table' is failed.
if (fp == NULL || fp->file != NULL) {

		mtx_unlock(&firmware_mtx);
		if (fp == NULL)
			printf("%s: firmware image loaded, "
			    "but did not register\n", fwli->imagename);
		(void) linker_release_module(fwli->imagename, NULL, NULL);
		mtx_lock(&firmware_mtx);
		goto done;

}

Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.822448] iicbus3: <Philips I2C bus> on lkpi_iic1
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.822490] iic3: <I2C generic I/O> on iicbus3
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.822538] lkpi_iic2: <LinuxKPI I2C> on drmn0
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.822571] iicbus4: <Philips I2C bus> on lkpi_iic2
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.822613] iic4: <I2C generic I/O> on iicbus4
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.823367] i915_glk_dmc_ver1_04_bin: firmware image loaded, but did not register
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.823517] drmn0: could not load firmware image 'i915/glk_dmc_ver1_04.bin'
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.823522] drmn0: [drm] Failed to load DMC firmware i915/glk_dmc_ver1_04.bin. Disabling runtime power management.
Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.823525] drmn0: [drm] Run pkg install gpu-firmware-kmod to install it

That's the normal operation for i915kms, it loads the firmware, uploads it to the GPU and release it as it's not needed anymore.
https://github.com/freebsd/drm-kmod/blob/master/drivers/gpu/drm/i915/display/intel_dmc.c#L633

Do you mean the FW ko loaded -> upload to GPU -> unload FW ko, and if we do 'kldstat', the FW ko is not listed. Right?

Where does your firmware kernel image come from and how old is it?

That's the normal operation for i915kms, it loads the firmware, uploads it to the GPU and release it as it's not needed anymore.
https://github.com/freebsd/drm-kmod/blob/master/drivers/gpu/drm/i915/display/intel_dmc.c#L633

Do you mean the FW ko loaded -> upload to GPU -> unload FW ko, and if we do 'kldstat', the FW ko is not listed. Right?

Yes

That's the normal operation for i915kms, it loads the firmware, uploads it to the GPU and release it as it's not needed anymore.
https://github.com/freebsd/drm-kmod/blob/master/drivers/gpu/drm/i915/display/intel_dmc.c#L633

Do you mean the FW ko loaded -> upload to GPU -> unload FW ko, and if we do 'kldstat', the FW ko is not listed. Right?

correct

If that's the error it would happend with all the firmwares that we provide, so I don't think that what you're saying is true.

OK. Let me confirm some facts:

  1. My i915 firmware module name is 'i915_glk_dmc_ver1_04_bin.ko'. Does your fw module have similar name format?
  2. I put the fw ko to /boot/kernel/. Do you put them in the same folder?
  3. Based on my debugging, 'firmware_register' registers the fw to table by the name 'i915/glk_dmc_ver1_04.bin'. Is that right?
  4. The fw ko will be loaded by a task 'loadimage', and the image name format is NOT similar to 'i915/glk_dmc_ver1_04.bin', but its format is similar to 'i915_glk_dmc_ver1_04_bin' since the ko format is 'i915_glk_dmc_ver1_04_bin.ko'. Is that right?
In D41729#951522, @bz wrote:

Where does your firmware kernel image come from and how old is it?

https://github.com/freebsd/drm-kmod-firmware. I will try the latest one my tomorrow. Does it impact the naming? GLK is the intel chipset several year ago.

That's the normal operation for i915kms, it loads the firmware, uploads it to the GPU and release it as it's not needed anymore.
https://github.com/freebsd/drm-kmod/blob/master/drivers/gpu/drm/i915/display/intel_dmc.c#L633

Do you mean the FW ko loaded -> upload to GPU -> unload FW ko, and if we do 'kldstat', the FW ko is not listed. Right?

In D41729#951520, @manu wrote:

No I really don't, it looks like you have a firmware with that name but that it contains crap data.

OK. If you look at the dmesg: '>> Sep 1 05:37:45 WT6C2B596A6985 kernel: [3.823367] i915_glk_dmc_ver1_04_bin: firmware image loaded, but did not register'. Why it reports this error, it is because fw is registered by the name "i915/glk_dmc_ver1_04.bin" while calling 'firmware_register', but the 'lookup' find the fw in table by the name 'i915_glk_dmc_ver1_04_bin', it is failed, so it reports this error.

If that's the error it would happend with all the firmwares that we provide, so I don't think that what you're saying is true.

OK. Let me confirm some facts:

  1. My i915 firmware module name is 'i915_glk_dmc_ver1_04_bin.ko'. Does your fw module have similar name format?

Yes, all firmwares are named the same, see https://cgit.freebsd.org/ports/tree/graphics/gpu-firmware-intel-kmod/pkg-plist

  1. I put the fw ko to /boot/kernel/. Do you put them in the same folder?

Both ports and package (and also compiling the firmwares directly from https://github.com/freebsd/drm-kmod-firmware/) will install them in /boot/modules.

  1. Based on my debugging, 'firmware_register' registers the fw to table by the name 'i915/glk_dmc_ver1_04.bin'. Is that right?

No, see https://dpaste.com/2VAAK6D6X
This is the generated C code for the firmware kernel module.

  1. The fw ko will be loaded by a task 'loadimage', and the image name format is NOT similar to 'i915/glk_dmc_ver1_04.bin', but its format is similar to 'i915_glk_dmc_ver1_04_bin' since the ko format is 'i915_glk_dmc_ver1_04_bin.ko'. Is that right?

The i915kms driver will attempt to load i915/glk_dmc_ver1_04.bin but our compat code will change this path to a FreeBSD compatible one.
See https://cgit.freebsd.org/src/tree/sys/compat/linuxkpi/common/src/linux_firmware.c#n59

To me this smells that the firmware is from before:
https://github.com/freebsd/drm-kmod-firmware/commit/f4f876a64d06143bec3e65c24ed9d5a6b8d6cb27
and
https://github.com/freebsd/drm-kmod-firmware/commit/efe0d9f294e4a3fa6673dc9c2ab4ec173dddf273

Also manually copying the firmware seems weird. Why don't you just try to install the package using fwget and see what happens?

In D41729#951563, @bz wrote:

To me this smells that the firmware is from before:
https://github.com/freebsd/drm-kmod-firmware/commit/f4f876a64d06143bec3e65c24ed9d5a6b8d6cb27
and
https://github.com/freebsd/drm-kmod-firmware/commit/efe0d9f294e4a3fa6673dc9c2ab4ec173dddf273

Also manually copying the firmware seems weird. Why don't you just try to install the package using fwget and see what happens?

Actually, I build the gpu drivers and firmwares from source by myself.

In D41729#951563, @bz wrote:

To me this smells that the firmware is from before:
https://github.com/freebsd/drm-kmod-firmware/commit/f4f876a64d06143bec3e65c24ed9d5a6b8d6cb27
and
https://github.com/freebsd/drm-kmod-firmware/commit/efe0d9f294e4a3fa6673dc9c2ab4ec173dddf273

Also manually copying the firmware seems weird. Why don't you just try to install the package using fwget and see what happens?

Actually, I build the gpu drivers and firmwares from source by myself.

Please test with a vanilla kernel and do pkg install drm-515-kmod gpu-firmware-intel-kmod-geminilake

  1. Based on my debugging, 'firmware_register' registers the fw to table by the name 'i915/glk_dmc_ver1_04.bin'. Is that right?

No, see https://dpaste.com/2VAAK6D6X

Oh, it is clear now. Based on this piece of code, the firmware is registered with the name 'i915_glk_dmc_ver1_04_bin', but my debugging shows it be registered by the name 'i915/glk_dmc_ver1_04.bin'. Is this piece of code in FreeBSD source or is it in the firmware building source? How can I move to this code?

  1. Based on my debugging, 'firmware_register' registers the fw to table by the name 'i915/glk_dmc_ver1_04.bin'. Is that right?

No, see https://dpaste.com/2VAAK6D6X

Oh, it is clear now. Based on this piece of code, the firmware is registered with the name 'i915_glk_dmc_ver1_04_bin', but my debugging shows it be registered by the name 'i915/glk_dmc_ver1_04.bin'. Is this piece of code in FreeBSD source or is it in the firmware building source? How can I move to this code?

It's generated code, you should never need to "move to this code" but if you want to see what's happening go to i915kmsfw/glkdmc_104 and make.

In D41729#951580, @manu wrote:
  1. Based on my debugging, 'firmware_register' registers the fw to table by the name 'i915/glk_dmc_ver1_04.bin'. Is that right?

No, see https://dpaste.com/2VAAK6D6X

Oh, it is clear now. Based on this piece of code, the firmware is registered with the name 'i915_glk_dmc_ver1_04_bin', but my debugging shows it be registered by the name 'i915/glk_dmc_ver1_04.bin'. Is this piece of code in FreeBSD source or is it in the firmware building source? How can I move to this code?

It's generated code, you should never need to "move to this code" but if you want to see what's happening go to i915kmsfw/glkdmc_104 and make.

I download the latest firmware soruce from https://github.com/freebsd/drm-kmod-firmware from master.
And I make the firmware kos and it generates 'i915_glk_dmc_ver1_04_bin.c', but it shows calling 'firmware_register' by the name 'i915/glk_dmc_ver1_04.bin', but not 'i915_glk_dmc_ver1_04_bin'. Where can I get the latest FreeBSD gpu firmware source code?

In D41729#951580, @manu wrote:
  1. Based on my debugging, 'firmware_register' registers the fw to table by the name 'i915/glk_dmc_ver1_04.bin'. Is that right?

No, see https://dpaste.com/2VAAK6D6X

Oh, it is clear now. Based on this piece of code, the firmware is registered with the name 'i915_glk_dmc_ver1_04_bin', but my debugging shows it be registered by the name 'i915/glk_dmc_ver1_04.bin'. Is this piece of code in FreeBSD source or is it in the firmware building source? How can I move to this code?

It's generated code, you should never need to "move to this code" but if you want to see what's happening go to i915kmsfw/glkdmc_104 and make.

I download the latest firmware soruce from https://github.com/freebsd/drm-kmod-firmware from master.
And I make the firmware kos and it generates 'i915_glk_dmc_ver1_04_bin.c', but it shows calling 'firmware_register' by the name 'i915/glk_dmc_ver1_04.bin', but not 'i915_glk_dmc_ver1_04_bin'. Where can I get the latest FreeBSD gpu firmware source code?

https://dpaste.com/CXTZE2TJY

I download the latest firmware soruce from https://github.com/freebsd/drm-kmod-firmware from master.
And I make the firmware kos and it generates 'i915_glk_dmc_ver1_04_bin.c', but it shows calling 'firmware_register' by the name 'i915/glk_dmc_ver1_04.bin', but not 'i915_glk_dmc_ver1_04_bin'. Where can I get the latest FreeBSD gpu firmware source code?

https://dpaste.com/CXTZE2TJY

No. I mean where I can get the latestgpu fw source code just like github, and then I can build the fw kos by myself. Does FreeBSD have git repo for gpu fw, or from ports?

I download the latest firmware soruce from https://github.com/freebsd/drm-kmod-firmware from master.
And I make the firmware kos and it generates 'i915_glk_dmc_ver1_04_bin.c', but it shows calling 'firmware_register' by the name 'i915/glk_dmc_ver1_04.bin', but not 'i915_glk_dmc_ver1_04_bin'. Where can I get the latest FreeBSD gpu firmware source code?

https://dpaste.com/CXTZE2TJY

No. I mean where I can get the latestgpu fw source code just like github, and then I can build the fw kos by myself. Does FreeBSD have git repo for gpu fw, or from ports?

https://github.com/freebsd/drm-kmod-firmware is the correct place, I was showing you that the firmware are correctly named when I build them, I don't know what you are doing wrong but clearly you're doing something wrong.

ps://dpaste.com/CXTZE2TJY

No. I mean where I can get the latestgpu fw source code just like github, and then I can build the fw kos by myself. Does FreeBSD have git repo for gpu fw, or from ports?

https://github.com/freebsd/drm-kmod-firmware is the correct place, I was showing you that the firmware are correctly named when I build them, I don't know what you are doing wrong but clearly you're doing something wrong.

Do you know how the C code been generated while making? Any scripts, or in which Makefile? I'd like to try change the registering name to the correct format.

bz removed a subscriber: bz.