Skip to content

Commit

Permalink
linux-firmware: rename packages for i915 firmware
Browse files Browse the repository at this point in the history
Change the package name from intel-igpu-firmware-* to i915-firmware-*,
the prefix "intel-igpu" is misleading, i915 firmware is not only for
iGPU but also for dGPU now.

Remove the redundant "intel" as i915 is already well known.

More accurate file classification to handle following files correctly:

  adlp_dmc.bin
  mtl_huc.bin
  mtl_huc_gsc.bin
  mtl_gsc_1.bin

The pattern in regex is "([[:alnum:]]+)_([[:alnum:]]+)(_[\w-.]+)?\.bin",
where $1 is the platform, $2 is the firmware type (dmc, guc, huc, etc.),
and the optional $3 which is revision or other suffix.

Glob first to narrow down the target file set, and then split with "_"
to extract the firmware type (remove the ".bin" in case there is no $3)

Add package "i915-firmware" as a meta package to install all the i915
firmwares, it is a balance between simplicity and optimization.

* Installing all the available firmwares as a whole, can support all the
  platforms, not only the current one but also the future ones. The
  price to pay is the increased size.
* If we want to minimize the storage, we can customize to install the
  necessary ones only, even for the target platform only (e.g. ADL) and
  skip the others. The price to pay is the time to tune.

What I am going to do is:

* Let drm-i915 driver depend on i915-firmware-dmc, which is small and
  can cover most of the old platforms
* Let the user select i915-firmware to install all the i915 firmwares as
  a whole to cover the latest or future platforms

Signed-off-by: Joe Zheng <[email protected]>
Link: openwrt#16276
Signed-off-by: Robert Marko <[email protected]>
  • Loading branch information
joez authored and robimarko committed Nov 15, 2024
1 parent 749a433 commit ca00baf
Showing 1 changed file with 38 additions and 18 deletions.
56 changes: 38 additions & 18 deletions package/firmware/linux-firmware/intel.mk
Original file line number Diff line number Diff line change
Expand Up @@ -216,29 +216,49 @@ define Package/e100-firmware/install
endef
$(eval $(call BuildPackage,e100-firmware))

Package/intel-igpu-firmware-dmc = $(call Package/firmware-default,Intel iGPU DMC Display MC firmware)
define Package/intel-igpu-firmware-dmc/install
i915_deps:=+i915-firmware-dmc +i915-firmware-guc +i915-firmware-huc +i915-firmware-gsc
Package/i915-firmware = $(call Package/firmware-default,Intel I915 firmware \(meta package\),$(i915_deps),LICENSE.i915)
define Package/i915-firmware/install
true
endef
$(eval $(call BuildPackage,i915-firmware))

Package/i915-firmware-dmc = $(call Package/firmware-default,Intel I915 DMC firmware,,LICENSE.i915)
define Package/i915-firmware-dmc/install
$(INSTALL_DIR) $(1)/lib/firmware/i915
$(CP) \
$(PKG_BUILD_DIR)/i915/*_dmc_*.bin* \
$(1)/lib/firmware/i915/
for f in $(PKG_BUILD_DIR)/i915/*_dmc*.bin; do \
t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \
if [ "$$$$t" = dmc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \
done
endef
$(eval $(call BuildPackage,intel-igpu-firmware-dmc))
$(eval $(call BuildPackage,i915-firmware-dmc))

Package/intel-igpu-firmware-guc = $(call Package/firmware-default,Intel iGPU GUC Graphics MC firmware)
define Package/intel-igpu-firmware-guc/install
Package/i915-firmware-guc = $(call Package/firmware-default,Intel I915 GUC firmware,,LICENSE.i915)
define Package/i915-firmware-guc/install
$(INSTALL_DIR) $(1)/lib/firmware/i915
$(CP) \
$(PKG_BUILD_DIR)/i915/*_guc_*.bin* \
$(1)/lib/firmware/i915/
for f in $(PKG_BUILD_DIR)/i915/*_guc*.bin; do \
t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \
if [ "$$$$t" = guc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \
done
endef
$(eval $(call BuildPackage,intel-igpu-firmware-guc))
$(eval $(call BuildPackage,i915-firmware-guc))

Package/intel-igpu-firmware-huc = $(call Package/firmware-default,Intel iGPU HUC H.265 MC firmware)
define Package/intel-igpu-firmware-huc/install
Package/i915-firmware-huc = $(call Package/firmware-default,Intel I915 HUC firmware,,LICENSE.i915)
define Package/i915-firmware-huc/install
$(INSTALL_DIR) $(1)/lib/firmware/i915
$(CP) \
$(PKG_BUILD_DIR)/i915/*_huc_*.bin* \
$(1)/lib/firmware/i915/
for f in $(PKG_BUILD_DIR)/i915/*_huc*.bin; do \
t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \
if [ "$$$$t" = huc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \
done
endef
$(eval $(call BuildPackage,i915-firmware-huc))

Package/i915-firmware-gsc = $(call Package/firmware-default,Intel I915 GSC firmware,,LICENSE.i915)
define Package/i915-firmware-gsc/install
$(INSTALL_DIR) $(1)/lib/firmware/i915
for f in $(PKG_BUILD_DIR)/i915/*_gsc*.bin; do \
t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \
if [ "$$$$t" = gsc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \
done
endef
$(eval $(call BuildPackage,intel-igpu-firmware-huc))
$(eval $(call BuildPackage,i915-firmware-gsc))

0 comments on commit ca00baf

Please sign in to comment.