tuanchris 3 месяцев назад
Родитель
Сommit
410d85d014
3 измененных файлов с 19 добавлено и 20 удалено
  1. 16 16
      dune-weaver-touch/install.sh
  2. 1 1
      dune-weaver-touch/run.sh
  3. 2 3
      dune-weaver-touch/start-with-fb-check.sh

+ 16 - 16
dune-weaver-touch/install.sh

@@ -87,24 +87,24 @@ setup_screen_rotation() {
     fi
     fi
 
 
     if [ -n "$BOOT_CONFIG" ]; then
     if [ -n "$BOOT_CONFIG" ]; then
-        # Comment out KMS for Freenove display compatibility
-        if grep -q "^dtoverlay=vc4-kms-v3d" "$BOOT_CONFIG"; then
-            sed -i 's/^dtoverlay=vc4-kms-v3d/#dtoverlay=vc4-kms-v3d/' "$BOOT_CONFIG"
-            echo "   ✅ Disabled vc4-kms-v3d (not compatible with Freenove rotation)"
-        fi
-
-        # Add display rotation if not present
-        if ! grep -q "display_rotate=2" "$BOOT_CONFIG"; then
-            echo "display_rotate=2" >> "$BOOT_CONFIG"
-            echo "   ✅ Added display_rotate=2"
-        fi
-
-        if ! grep -q "lcd_rotate=2" "$BOOT_CONFIG"; then
-            echo "lcd_rotate=2" >> "$BOOT_CONFIG"
-            echo "   ✅ Added lcd_rotate=2"
+        # Ensure FKMS is enabled (required for Freenove display)
+        if ! grep -q "^dtoverlay=vc4-fkms-v3d" "$BOOT_CONFIG"; then
+            # Check if KMS (full) is present and replace it
+            if grep -q "^dtoverlay=vc4-kms-v3d" "$BOOT_CONFIG"; then
+                sed -i 's/^dtoverlay=vc4-kms-v3d/dtoverlay=vc4-fkms-v3d/' "$BOOT_CONFIG"
+                echo "   ✅ Changed vc4-kms-v3d to vc4-fkms-v3d (required for display)"
+            else
+                echo "dtoverlay=vc4-fkms-v3d" >> "$BOOT_CONFIG"
+                echo "   ✅ Added vc4-fkms-v3d overlay"
+            fi
+        else
+            echo "   ℹ️  FKMS already enabled"
         fi
         fi
 
 
-        echo "   🔄 Screen rotation (180°) configured in $BOOT_CONFIG"
+        # Note: display_rotate and lcd_rotate don't work with linuxfb
+        # Rotation is handled by Qt's rotation parameter in startup scripts
+        echo "   ℹ️  Display rotation handled by Qt (linuxfb:rotation=180)"
+        echo "   🔄 Screen rotation (180°) will be applied by application startup"
     else
     else
         echo "   ⚠️  Boot config not found - rotation not configured"
         echo "   ⚠️  Boot config not found - rotation not configured"
     fi
     fi

+ 1 - 1
dune-weaver-touch/run.sh

@@ -52,8 +52,8 @@ echo ""
 cd "$SCRIPT_DIR"
 cd "$SCRIPT_DIR"
 
 
 # Set Qt platform to linuxfb for Raspberry Pi compatibility with 180° rotation
 # Set Qt platform to linuxfb for Raspberry Pi compatibility with 180° rotation
+# LinuxFB with FKMS: use Qt's rotation parameter
 export QT_QPA_PLATFORM=linuxfb:fb=/dev/fb0:rotation=180
 export QT_QPA_PLATFORM=linuxfb:fb=/dev/fb0:rotation=180
-export QT_QPA_FB_DRM=1
 export QT_QPA_FONTDIR=/usr/share/fonts
 export QT_QPA_FONTDIR=/usr/share/fonts
 
 
 # Configure touch screen rotation (180 degrees)
 # Configure touch screen rotation (180 degrees)

+ 2 - 3
dune-weaver-touch/start-with-fb-check.sh

@@ -45,10 +45,9 @@ sleep 2
 echo "🚀 Starting Dune Weaver Touch..."
 echo "🚀 Starting Dune Weaver Touch..."
 cd "$SCRIPT_DIR"
 cd "$SCRIPT_DIR"
 
 
-# Configure Qt platform environment variables with 180° rotation
-# rotation=180 tells Qt to rotate its rendering to match the framebuffer
+# Configure Qt platform environment variables
+# LinuxFB with FKMS: use Qt's rotation parameter since FKMS doesn't rotate the raw framebuffer
 export QT_QPA_PLATFORM=linuxfb:fb=/dev/fb0:rotation=180
 export QT_QPA_PLATFORM=linuxfb:fb=/dev/fb0:rotation=180
-export QT_QPA_FB_DRM=1
 export QT_QPA_FONTDIR=/usr/share/fonts
 export QT_QPA_FONTDIR=/usr/share/fonts
 
 
 # Configure touch screen rotation (180 degrees)
 # Configure touch screen rotation (180 degrees)