Skip to content

Commit ca00baf

Browse files
joezrobimarko
authored andcommitted
linux-firmware: rename packages for i915 firmware
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/openwrt#16276 Signed-off-by: Robert Marko <[email protected]>
1 parent 749a433 commit ca00baf

File tree

1 file changed

+38
-18
lines changed

1 file changed

+38
-18
lines changed

package/firmware/linux-firmware/intel.mk

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -216,29 +216,49 @@ define Package/e100-firmware/install
216216
endef
217217
$(eval $(call BuildPackage,e100-firmware))
218218

219-
Package/intel-igpu-firmware-dmc = $(call Package/firmware-default,Intel iGPU DMC Display MC firmware)
220-
define Package/intel-igpu-firmware-dmc/install
219+
i915_deps:=+i915-firmware-dmc +i915-firmware-guc +i915-firmware-huc +i915-firmware-gsc
220+
Package/i915-firmware = $(call Package/firmware-default,Intel I915 firmware \(meta package\),$(i915_deps),LICENSE.i915)
221+
define Package/i915-firmware/install
222+
true
223+
endef
224+
$(eval $(call BuildPackage,i915-firmware))
225+
226+
Package/i915-firmware-dmc = $(call Package/firmware-default,Intel I915 DMC firmware,,LICENSE.i915)
227+
define Package/i915-firmware-dmc/install
221228
$(INSTALL_DIR) $(1)/lib/firmware/i915
222-
$(CP) \
223-
$(PKG_BUILD_DIR)/i915/*_dmc_*.bin* \
224-
$(1)/lib/firmware/i915/
229+
for f in $(PKG_BUILD_DIR)/i915/*_dmc*.bin; do \
230+
t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \
231+
if [ "$$$$t" = dmc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \
232+
done
225233
endef
226-
$(eval $(call BuildPackage,intel-igpu-firmware-dmc))
234+
$(eval $(call BuildPackage,i915-firmware-dmc))
227235

228-
Package/intel-igpu-firmware-guc = $(call Package/firmware-default,Intel iGPU GUC Graphics MC firmware)
229-
define Package/intel-igpu-firmware-guc/install
236+
Package/i915-firmware-guc = $(call Package/firmware-default,Intel I915 GUC firmware,,LICENSE.i915)
237+
define Package/i915-firmware-guc/install
230238
$(INSTALL_DIR) $(1)/lib/firmware/i915
231-
$(CP) \
232-
$(PKG_BUILD_DIR)/i915/*_guc_*.bin* \
233-
$(1)/lib/firmware/i915/
239+
for f in $(PKG_BUILD_DIR)/i915/*_guc*.bin; do \
240+
t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \
241+
if [ "$$$$t" = guc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \
242+
done
234243
endef
235-
$(eval $(call BuildPackage,intel-igpu-firmware-guc))
244+
$(eval $(call BuildPackage,i915-firmware-guc))
236245

237-
Package/intel-igpu-firmware-huc = $(call Package/firmware-default,Intel iGPU HUC H.265 MC firmware)
238-
define Package/intel-igpu-firmware-huc/install
246+
Package/i915-firmware-huc = $(call Package/firmware-default,Intel I915 HUC firmware,,LICENSE.i915)
247+
define Package/i915-firmware-huc/install
239248
$(INSTALL_DIR) $(1)/lib/firmware/i915
240-
$(CP) \
241-
$(PKG_BUILD_DIR)/i915/*_huc_*.bin* \
242-
$(1)/lib/firmware/i915/
249+
for f in $(PKG_BUILD_DIR)/i915/*_huc*.bin; do \
250+
t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \
251+
if [ "$$$$t" = huc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \
252+
done
253+
endef
254+
$(eval $(call BuildPackage,i915-firmware-huc))
255+
256+
Package/i915-firmware-gsc = $(call Package/firmware-default,Intel I915 GSC firmware,,LICENSE.i915)
257+
define Package/i915-firmware-gsc/install
258+
$(INSTALL_DIR) $(1)/lib/firmware/i915
259+
for f in $(PKG_BUILD_DIR)/i915/*_gsc*.bin; do \
260+
t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \
261+
if [ "$$$$t" = gsc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \
262+
done
243263
endef
244-
$(eval $(call BuildPackage,intel-igpu-firmware-huc))
264+
$(eval $(call BuildPackage,i915-firmware-gsc))

0 commit comments

Comments
 (0)