Clean up DRM drivers. Keeping deblobbed drivers enabled in clean_kconfig.
authorlxoliva <lxoliva@559672b5-ba27-0410-b829-e8f1faed8b1b>
Tue, 27 Jan 2009 19:14:10 +0000 (19:14 +0000)
committerlxoliva <lxoliva@559672b5-ba27-0410-b829-e8f1faed8b1b>
Tue, 27 Jan 2009 19:14:10 +0000 (19:14 +0000)
git-svn-id: http://www.fsfla.org/svn/fsfla/software/linux-libre/scripts@4710 559672b5-ba27-0410-b829-e8f1faed8b1b

deblob-2.6.28
deblob-check

index d03cb192b66b8976a59f373d511aafeee8f000be..bb80e54839e41f18549c66415d9679beb307da47 100755 (executable)
@@ -140,6 +140,16 @@ drop_fw_file () {
 
 clean_kconfig () {
         #$1 = filename $2 = things to remove
+       case $1 in
+       -f)
+               shift
+               ;;
+       *)
+               if $have_check; then
+                       return
+               fi
+               ;;
+       esac
         echo Marking config $2 as depending on NONFREE in $1
        sed "/^config \\($2\\)\$/{p;i\
        depends on NONFREE
@@ -282,14 +292,14 @@ announce ATM_AMBASSADOR -  Madge Ambassador, Collage PCI 155 Server
 reject_firmware drivers/atm/ambassador.c
 clean_blob drivers/atm/ambassador.c
 clean_fw firmware/atmsar11.HEX firmware/atmsar11.fw
-$have_check || clean_kconfig drivers/atm/Kconfig 'ATM_AMBASSADOR'
+clean_kconfig drivers/atm/Kconfig 'ATM_AMBASSADOR'
 clean_mk CONFIG_ATM_AMBASSADOR drivers/atm/Makefile
 
 announce ATM_FORE200E_PCA, ATM_FORE200E_SBA - SBA-200E
 reject_firmware drivers/atm/fore200e.c
 clean_blob drivers/atm/fore200e.c
 clean_blob Documentation/networking/fore200e.txt
-$have_check || clean_kconfig drivers/atm/Kconfig 'ATM_FORE.*'
+clean_kconfig drivers/atm/Kconfig 'ATM_FORE.*'
 clean_mk CONFIG_ATM_FORE200E drivers/atm/Makefile
 
 
@@ -301,22 +311,47 @@ clean_mk CONFIG_ATM_FORE200E drivers/atm/Makefile
 drop_fw_file firmware/intelliport2.bin.ihex firmware/intelliport2.bin
 reject_firmware drivers/char/ip2/ip2main.c
 clean_blob drivers/char/ip2/ip2main.c
-$have_check || clean_kconfig drivers/char/Kconfig 'COMPUTONE'
+clean_kconfig drivers/char/Kconfig 'COMPUTONE'
 clean_mk CONFIG_COMPUTONE drivers/char/Makefile
 
 # gpu drm
 
 # DRM_MGA - Matrox g200/g400
 clean_blob drivers/gpu/drm/mga/mga_ucode.h
+clean_blob drivers/gpu/drm/mga/mga_warp.c
 clean_kconfig drivers/gpu/drm/Kconfig 'DRM_MGA'
 clean_mk CONFIG_DRM_MGA drivers/gpu/drm/Makefile
 
 # DRM_R128 - ATI Rage 128
+clean_sed '/^static int r128_do_init_cce(/,/^}$/{
+  /^   r128_cce_load_microcode(dev_priv);$/{
+    i\
+       DRM_ERROR("Missing Free microcode!\\n");\
+       dev->dev_private = (void *)dev_priv;\
+       r128_do_cleanup_cce(dev);\
+       return -EINVAL;
+  }
+}' drivers/gpu/drm/r128/r128_cce.c
 clean_blob drivers/gpu/drm/r128/r128_cce.c
 clean_kconfig drivers/gpu/drm/Kconfig 'DRM_R128'
 clean_mk CONFIG_DRM_R128 drivers/gpu/drm/Makefile
 
 # DRM_RADEON - ATI Radeon
+clean_sed '/^static int radeon_do_init_cce(/,/^}$/{
+  /^   radeon_cp_load_microcode(dev_priv);$/{
+    i\
+       DRM_ERROR("Missing Free microcode!\\n");\
+       radeon_do_cleanup_cp(dev);\
+       return -EINVAL;
+  }
+}
+/^static int radeon_do_resume_cp(/,/^}$/{
+  /^   radeon_cp_load_microcode(dev_priv);$/{
+    i\
+       DRM_ERROR("Missing Free microcode!\\n");\
+       return -EINVAL;
+  }
+}' drivers/gpu/drm/radeon/radeon_cp.c
 clean_blob drivers/gpu/drm/radeon/radeon_microcode.h
 clean_kconfig drivers/gpu/drm/Kconfig 'DRM_RADEON'
 clean_mk CONFIG_DRM_RADEON drivers/gpu/drm/Makefile
index 78136262d55591b2f750d72fb9d8ada6c28c4e95..8d87aa79026e77a4e0699a62ebae805b6fd8b900 100755 (executable)
@@ -859,6 +859,20 @@ set_except () {
 
     blobna 'intelliport2\.bin' drivers/char/ip2/ip2main.c
 
+    blob 'static unsigned char warp_g[24]00_t2\?gzs\?a\?f\?\[\] = {[^{};]*};\([\n][\n]*static unsigned char warp_g[24]00_t2\?gzs\?a\?f\?\[\] = {[^{};]*};\)*' drivers/gpu/drm/mga/mga_ucode.h
+    blob '#define \(MGA_WARP_CODE_ALIGN\|WARP_UCODE_\(SIZE\|INSTALL\)\)\([^\n]*\\[     ]*[\n]\)*[^\n]*' drivers/gpu/drm/mga/mga_warp.c
+    blob 'static const unsigned int mga_warp_g[24]00_microcode_size =[^;]*;' drivers/gpu/drm/mga/mga_warp.c
+    blob 'static int mga_warp_install_g[24]00_microcode([^{]*)[\n]{[\n]\([^}]\|[^\n}]}*\)*[\n]}[\n]' drivers/gpu/drm/mga/mga_warp.c
+    blobna '\(case MGA_CARD_TYPE_G[^:]*:[      \n]*\)\+return [^;]*mga_warp[^;]*microcode[^;]*;\([     \n]*\(case MGA_CARD_TYPE_G[^:]*:[       \n]*\)\+return [^;]*mga_warp[^;]*microcode[^;]*;[       ]*\)*' drivers/gpu/drm/mga/mga_warp.c
+
+    blob 'static u32 r128_cce_microcode\[\] = {[^{};]*};' drivers/gpu/drm/r128/r128_cce.c
+    blob 'static void r128_cce_load_microcode([^{]*)[\n]{[\n]\([^}]\|[^\n}]}*\)*[\n]}[\n]' drivers/gpu/drm/r128/r128_cce.c
+    blob '     r128_cce_load_microcode([^;]*);' drivers/gpu/drm/r128/r128_cce.c
+
+    blob 'static const u32 R[S0-9]*0_cp_microcode\[\]\[2\] = {[^{};]*};\([\n][\n]*static const u32 R[S0-9]*0_cp_microcode\[\]\[2\] = {[^{};]*};\)*' drivers/gpu/drm/radeon/radeon_microcode.h
+    blob 'static void radeon_cp_load_microcode([^{]*)[\n]{[\n]\([^}]\|[^\n}]}*\)*[\n]}[\n]' drivers/gpu/drm/radeon/radeon_cp.c
+    blob '     radeon_cp_load_microcode([^;]*);' drivers/gpu/drm/radeon/radeon_cp.c
+
     blobna '\(agere\|prism\)_\(sta\|ap\)_fw\.bin' drivers/net/wireless/orinoco.c
     blobna 'symbol_sp24t_\(prim\|sec\)_fw' drivers/net/wireless/orinoco.c