weston-ini-conf: Rework to use fragments to construct weston.ini 75/11375/5
authorTom Rini <trini@konsulko.com>
Wed, 18 Oct 2017 13:38:05 +0000 (09:38 -0400)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Fri, 20 Oct 2017 22:18:30 +0000 (22:18 +0000)
Switch to constructing the weston.ini from fragments of files instead of
variables and variable flags.  This allows for much easier tracking of
signatures by leveraging existing mechanisms.  Update the Readme to
explain how to do the various operations with fragments as well.  Note
that for QEMU we do not need to pass -show-cursor as it's already
provided and we do want to change the VGA driver to one that reliably
provides DRM support.

For the HDMI connected screens, rather than name them by vendor name
them first for connection and then required transformation for correct
orientation.

For board-specific options, move them to the board directories.

When we need to change existing cfg options, rather than replace them
the proper location to do this in is the do_configure function.

Bug-AGL: SPEC-964
Change-Id: I2cceb4fd64f51eb2ab1d47419b77153cf02d7c12
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-on: https://gerrit.automotivelinux.org/gerrit/11375
Reviewed-by: Stéphane Desneux <stephane.desneux@iot.bzh>
Tested-by: Jenkins Job builder account <agl-jobbuilder@automotivelinux.org>
ci-image-build: Jenkins Job builder account <agl-jobbuilder@automotivelinux.org>
ci-image-boot-test: Jenkins Job builder account <agl-jobbuilder@automotivelinux.org>
Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
27 files changed:
meta-agl-bsp/conf/include/agl_qemux86-64.inc
meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston-ini-conf.bbappend
meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston-ini-conf/fbdev.cfg [new file with mode: 0644]
meta-agl-bsp/meta-intel/recipes-graphics/wayland/weston-ini-conf.bbappend
meta-agl-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf.bbappend
meta-agl-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf/dsi.cfg [new file with mode: 0644]
meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf.bbappend
meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/v4l2-renderer.cfg [new file with mode: 0644]
meta-agl-bsp/meta-renesas/recipes-graphics/wayland/weston-ini-conf.bbappend
meta-agl-bsp/meta-renesas/recipes-graphics/wayland/weston-ini-conf/lvds-off.cfg [new file with mode: 0644]
meta-agl-bsp/meta-ti/recipes-graphics/wayland/weston-ini-conf.bbappend
meta-agl-bsp/meta-ti/recipes-graphics/wayland/weston-ini-conf/unnamed.cfg [new file with mode: 0644]
meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf.bbappend
meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/virtual.cfg [moved from meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_qemu.inc with 65% similarity]
meta-agl-bsp/recipes-graphics/wayland/weston/weston-qemu-drm.ini [deleted file]
meta-agl/recipes-graphics/wayland/Readme.weston-ini-conf
meta-agl/recipes-graphics/wayland/weston-ini-conf.bb
meta-agl/recipes-graphics/wayland/weston-ini-conf/core.cfg [new file with mode: 0644]
meta-agl/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-270.cfg [new file with mode: 0644]
meta-agl/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-90.cfg [new file with mode: 0644]
meta-agl/recipes-graphics/wayland/weston-ini-conf/ivishell.cfg [new file with mode: 0644]
meta-agl/recipes-graphics/wayland/weston-ini-conf/screen.inc [deleted file]
meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_DSI.inc [deleted file]
meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_GeChic.inc [deleted file]
meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_dell.inc [deleted file]
meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_eGalax.inc [deleted file]
meta-agl/recipes-graphics/wayland/weston-ini-conf/shell.cfg [new file with mode: 0644]

index 513462e..3ad9c51 100644 (file)
@@ -26,5 +26,5 @@ AGL_EXTRA_IMAGE_FSTYPES = "vmdk.xz"
 # Root device
 ROOT_VM = "root=PARTUUID=${DISK_SIGNATURE}-02"
 
-# runqemu tweaks
-QB_OPT_APPEND_append = " -show-cursor"
+# Force the virtio video device as 'vmware' doesn't always work
+QB_OPT_APPEND_append = " -vga virtio"
index 14f4c27..ec6cbac 100644 (file)
@@ -1,10 +1,11 @@
 # Currently only works with fbdev backend
 # and only one default output
 
-WESTONCORE[backend] = "fbdev-backend.so"
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 
-SCREEN_fbdev[name] = "fbdev"
-SCREEN_fbdev[transform] = "270"
-WESTONOUTPUT1[agl_screen] = "SCREEN_fbdev"
+SRC_URI_remove = "file://hdmi-a-1-270.cfg"
+SRC_URI += "file://fbdev.cfg"
 
-do_generate_weston_init[vardeps] += "SCREEN_fbdev"
+do_configure() {
+    sed -i -e 's/drm-backend/fbdev-backend/' ${WORKDIR}/core.cfg
+}
diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston-ini-conf/fbdev.cfg b/meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston-ini-conf/fbdev.cfg
new file mode 100644 (file)
index 0000000..b1a1f3c
--- /dev/null
@@ -0,0 +1,3 @@
+[output]
+name=fbdev
+transform=270
index 731578e..0076719 100644 (file)
@@ -1,4 +1,3 @@
-# Select default screen type and orientation
-# and only one default output
-
-WESTONOUTPUT1[agl_screen] = "SCREEN_eGalax"
+# Select a different rotation for our default panel.
+SRC_URI_remove = "file://hdmi-a-1-270.cfg"
+SRC_URI += "file://hdmi-a-1-90.cfg"
index 37383c2..33dfd6a 100644 (file)
@@ -1,6 +1,3 @@
-# Disable LVDS
-WESTONOUTPUT2[agl_screen] ??= "SCREEN_DSI"
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 
-WESTONSECTION[WESTONOUTPUT2] = "output"
-
-do_generate_weston_init[vardeps] += "WESTONOUTPUT2"
+SRC_URI += "file://dsi.cfg"
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf/dsi.cfg b/meta-agl-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf/dsi.cfg
new file mode 100644 (file)
index 0000000..72a6d2b
--- /dev/null
@@ -0,0 +1,5 @@
+# Support the Raspberry Pi Foundation 7" tablet which uses the DSI connector
+# rather than HDMI.
+[output]
+name=DSI-1
+transform=270
index 661af2b..78be211 100644 (file)
@@ -1,14 +1,10 @@
-WESTONCORE[repaint-window] ??= "34"
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 
-WESTONIVISHELL[transition-duration] ??= "300"
-WESTONIVISHELL[cursor-theme] ??= "default"
+SRC_URI += "${@bb.utils.contains("MACHINE_FEATURES", "multimedia", "file://v4l2-renderer.cfg", "",d)}"
 
-WESTONV4L2RENDERER[device] ??= "/dev/media0"
-WESTONV4L2RENDERER[device-module] ??= "vsp2"
+do_configure() {
+    echo repaint-window=34 >> ${WORKDIR}/core.cfg
 
-python() {
-    if "multimedia" in d.getVar("MACHINE_FEATURES", True).split(" "):
-        d.setVarFlag("WESTONSECTION", "WESTONV4L2RENDERER", "v4l2-renderer")
+    echo transition-duration=300 >> ${WORKDIR}/ivishell.cfg
+    echo cursor-theme=default >> ${WORKDIR}/ivishell.cfg
 }
-
-do_generate_weston_init[vardeps] += "WESTONIVISHELL WESTONV4L2RENDERER"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/v4l2-renderer.cfg b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/v4l2-renderer.cfg
new file mode 100644 (file)
index 0000000..135f230
--- /dev/null
@@ -0,0 +1,3 @@
+[v4l2-renderer]
+device=/dev/media0
+device-module=vsp2
index 4a04948..d92f784 100644 (file)
@@ -1,7 +1,4 @@
-# Disable LVDS
-WESTONOUTPUT2[name] = "LVDS-1"
-WESTONOUTPUT2[mode] = "off"
-
-WESTONSECTION[WESTONOUTPUT2] = "output"
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 
-do_generate_weston_init[vardeps] += "WESTONOUTPUT2"
+# Disable LVDS
+SRC_URI += "file://lvds-off.cfg"
diff --git a/meta-agl-bsp/meta-renesas/recipes-graphics/wayland/weston-ini-conf/lvds-off.cfg b/meta-agl-bsp/meta-renesas/recipes-graphics/wayland/weston-ini-conf/lvds-off.cfg
new file mode 100644 (file)
index 0000000..8c14113
--- /dev/null
@@ -0,0 +1,3 @@
+[output]
+name=LVDS-1
+mode=off
index e5f4927..914a873 100644 (file)
@@ -1 +1,7 @@
-DEFAULT_SCREEN[name] = "UNNAMED-1"
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+# While we could have a panel attached to HDMI, we only use the default
+# panel isntead.
+SRC_URI_remove = "file://hdmi-a-1-270.cfg"
+# Our DPI panel shows up as "UNNAMED-1"
+SRC_URI += "file://unnamed.cfg"
diff --git a/meta-agl-bsp/meta-ti/recipes-graphics/wayland/weston-ini-conf/unnamed.cfg b/meta-agl-bsp/meta-ti/recipes-graphics/wayland/weston-ini-conf/unnamed.cfg
new file mode 100644 (file)
index 0000000..2954493
--- /dev/null
@@ -0,0 +1,3 @@
+[output]
+name=UNNAMED-1
+transform=270
index dba2ad6..8fa08bc 100644 (file)
@@ -1,17 +1,9 @@
-# OVERRIDES save us some c'n'p below ...
-OVERRIDES_prepend_qemux86 = "customwestonini:"
-OVERRIDES_prepend_qemux86-64 = "customwestonini:"
-# intel-corei7-64 ??
-
-python() {
-    if "customwestonini" in d.getVar("OVERRIDES", True).split(":"):
-        # DRM backend disabled for now to allow compatibility with VirtualBox
-        # and VMWare Player. It may be re-enabled if running on QEMU for
-        # potentially increased performance.
-        #backend=drm-backend.so
-        d.delVarFlag("WESTONCORE", "backend")
-
-        d.setVarFlag("WESTONOUTPUT1","agl_screen", "SCREEN_QEMU")
-}
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 
+# OVERRIDES save us some c'n'p below ...
+OVERRIDES_prepend_qemux86 = "virtualmachine:"
+OVERRIDES_prepend_qemux86-64 = "virtualmachine:"
 
+# Switch to the Virtual section that we have when a valid DRM device is found
+SRC_URI_remove_virtualmachine = "file://hdmi-a-1-270.cfg"
+SRC_URI_append_virtualmachine = " file://virtual.cfg"
@@ -1,9 +1,10 @@
-SCREEN_QEMU[name]?="Virtual-1"
+[output]
+name=Virtual-1
 #mode=1920x1080
 #mode=1600x1200
 #mode=1680x1050
 #mode=1400x1050
-SCREEN_QEMU[mode]?="1600x900"
+mode=1600x900
 #mode=1280x1024
 #mode=1440x900
 #mode=1280x960
@@ -14,5 +15,3 @@ SCREEN_QEMU[mode]?="1600x900"
 #mode=800x600
 #mode=848x480
 #mode=640x480
-
-do_generate_weston_init[vardeps] += "SCREEN_QEMU"
diff --git a/meta-agl-bsp/recipes-graphics/wayland/weston/weston-qemu-drm.ini b/meta-agl-bsp/recipes-graphics/wayland/weston/weston-qemu-drm.ini
deleted file mode 100644 (file)
index f502eff..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-[core]
-shell=ivi-shell.so
-# DRM backend disabled for now to allow compatibility with VirtualBox
-# and VMWare Player. It may be re-enabled if running on QEMU for
-# potentially increased performance.
-#backend=drm-backend.so
-
-[ivi-shell]
-ivi-module=ivi-controller.so
-ivi-input-module=ivi-input-controller.so
-
-[output]
-name=Virtual-1
-#mode=1920x1080
-#mode=1600x1200
-#mode=1680x1050
-#mode=1400x1050
-mode=1600x900
-#mode=1280x1024
-#mode=1440x900
-#mode=1280x960
-#mode=1360x768
-#mode=1280x800
-#mode=1280x768
-#mode=1280x720
-#mode=800x600
-#mode=848x480
-#mode=640x480
index eb30a9a..bbd5a80 100644 (file)
@@ -1,36 +1,34 @@
-#Generate a weston.ini file:
+##Generate a weston.ini file:
 
-To generate the weston.ini file:
+To modify any of the default sections (core, shell, ivi-shell), add a
+do_configure() function to your bbappend:
 
 '''
-[core]
-backend=drm-backend.so
-shell=desktop-shell.so
-'''
-
-Just create a Variable Flag:
+do_configure() {
+    echo repaint-window=34 >> ${WORKDIR}/core.cfg
 
+    echo transition-duration=300 >> ${WORKDIR}/ivishell.cfg
+    echo cursor-theme=default >> ${WORKDIR}/ivishell.cfg
+}
 '''
-WESTONCORE[backend]??="drm-backend.so"
-WESTONCORE[shell]??="desktop-shell.so"
-'''
-
-And add it to the Variable Flag WESTONSECTION, with the name of the section:
+or:
 '''
-WESTONSECTION[WESTONCORE]?="core"
+do_configure() {
+    sed -i -e 's/drm-backend/fbdev-backend/' ${WORKDIR}/core.cfg
+}
 '''
 
-#You can custumize weston.ini by create a weston-ini-conf.bbappend:
+To change the display from the default assumption of an HDMI-1-A connected
+screen that needs to be rotated 270 degrees:
 
 '''
-WESTONCORE[repaint-window] ??= "34"
+SRC_URI_remove = "file://hdmi-a-1-270.cfg"
+SRC_URI += "file://hdmi-a-1-90.cfg"
 '''
 
-This will generate weston.ini file:
-
+To add new sections just list them in SRC_URI:
 '''
-[core]
-backend=drm-backend.so
-shell=ivi-shell.so
-repaint-window=34
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://dsi.cfg"
 '''
index 0edc05d..9ba49bf 100644 (file)
@@ -2,57 +2,26 @@ SUMMARY = "Startup script and systemd unit file for the Weston Wayland composito
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"
 
-S = "${WORKDIR}"
-
-require weston-ini-conf/screen.inc
-
-DEFAULT_SCREEN[transform]?="270"
-DEFAULT_SCREEN[name]?="HDMI-A-1"
-
-WESTONCORE[shell]??="desktop-shell.so"
-WESTONCORE[backend]??="drm-backend.so"
-WESTONCORE[require-input]??="false"
-
-WESTONSHELL[locking]="true"
-# hide panel
-WESTONSHELL[panel-location]="none"
+SRC_URI = "file://core.cfg \
+           file://ivishell.cfg \
+           file://shell.cfg \
+           file://hdmi-a-1-270.cfg \
+          "
 
+S = "${WORKDIR}"
 
-WESTONOUTPUT1[agl_screen]??="DEFAULT_SCREEN"
-
-WESTONSECTION[WESTONCORE]?="core"
-WESTONSECTION[WESTONSHELL]?="shell"
-WESTONSECTION[WESTONOUTPUT1]?="output"
-
-python do_generate_weston_init() {
-    with open(d.getVar('WORKDIR', True)+"/weston.ini"  ,'w') as weston_ini:
-        dicoSection=d.getVarFlags('WESTONSECTION')
-        keysSection=list(dicoSection.keys())
-        keysSection.sort()
-        for section in keysSection:
-            weston_ini.writelines( "["+dicoSection[section]+"]\n")
-            dicoSectionValues=d.getVarFlags(section)
-            keysSectionValues=list(dicoSectionValues.keys())
-            keysSectionValues.sort()
-            for sectionValue in keysSectionValues:
-                if (dicoSection[section] == "output" and sectionValue == "agl_screen"):
-                    screen=dicoSectionValues[sectionValue]
-                    dicoScreenConfig=d.getVarFlags(screen)
-                    keysScreenConfig=list(dicoScreenConfig.keys())
-                    keysScreenConfig.sort()
-                    for screenConfig in keysScreenConfig:
-                        weston_ini.writelines( screenConfig+"="+dicoScreenConfig[screenConfig]+"\n")
-                else:
-                    weston_ini.writelines( str(sectionValue)+"="+str(dicoSectionValues[sectionValue])+"\n")
+PACKAGE_ARCH = "${MACHINE_ARCH}"
 
-            weston_ini.writelines( "\n")
+do_compile() {
+    # Put all of our cfg files together.
+    rm -f ${WORKDIR}/weston.ini
+    for F in ${WORKDIR}/*.cfg; do
+        cat $F >> ${WORKDIR}/weston.ini
+        echo >> ${WORKDIR}/weston.ini
+    done
+    sed -i -e '$ d' ${WORKDIR}/weston.ini
 }
 
-#ar_src = d.getVarFlag('ARCHIVER_MODE', 'src', True)
-
-addtask do_generate_weston_init after do_compile before do_install
-do_generate_weston_init[vardeps] = "DEFAULT_SCREEN WESTONCORE WESTONSHELL WESTONOUTPUT1 WESTONSECTION"
-
 do_install_append() {
     WESTON_INI_CONFIG=${sysconfdir}/xdg/weston
     install -d ${D}${WESTON_INI_CONFIG}
diff --git a/meta-agl/recipes-graphics/wayland/weston-ini-conf/core.cfg b/meta-agl/recipes-graphics/wayland/weston-ini-conf/core.cfg
new file mode 100644 (file)
index 0000000..a0ec1e1
--- /dev/null
@@ -0,0 +1,4 @@
+[core]
+shell=ivi-shell.so
+backend=drm-backend.so
+require-input=false
diff --git a/meta-agl/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-270.cfg b/meta-agl/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-270.cfg
new file mode 100644 (file)
index 0000000..dffc2b6
--- /dev/null
@@ -0,0 +1,6 @@
+# A display is connected to HDMI-A-1 and needs to be rotated 270 degrees
+# to have a proper orientation of the homescreen.  For example the various sizes
+# of the GeChic display or the Dell display.
+[output]
+name=HDMI-A-1
+transform=270
diff --git a/meta-agl/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-90.cfg b/meta-agl/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-90.cfg
new file mode 100644 (file)
index 0000000..88a692a
--- /dev/null
@@ -0,0 +1,6 @@
+# A display is connected to HDMI-A-1 and needs to be rotated 90 degrees
+# to have a proper orientation of the homescreen.  For example, the 'eGalax'
+# display used in some instances.
+[output]
+name=HDMI-A-1
+transform=90
diff --git a/meta-agl/recipes-graphics/wayland/weston-ini-conf/ivishell.cfg b/meta-agl/recipes-graphics/wayland/weston-ini-conf/ivishell.cfg
new file mode 100644 (file)
index 0000000..1c4304c
--- /dev/null
@@ -0,0 +1,3 @@
+[ivi-shell]
+ivi-input-module=ivi-input-controller.so
+ivi-module=ivi-controller.so
diff --git a/meta-agl/recipes-graphics/wayland/weston-ini-conf/screen.inc b/meta-agl/recipes-graphics/wayland/weston-ini-conf/screen.inc
deleted file mode 100644 (file)
index e91e902..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-require screen_dell.inc
-require screen_qemu.inc
-require screen_GeChic.inc
-require screen_DSI.inc
-require screen_eGalax.inc
diff --git a/meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_DSI.inc b/meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_DSI.inc
deleted file mode 100644 (file)
index e0b39b3..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-SCREEN_DSI[name] ?= "DSI-1"
-SCREEN_DSI[transform] ?= "270"
-
-do_generate_weston_init[vardeps] += "SCREEN_DSI"
diff --git a/meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_GeChic.inc b/meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_GeChic.inc
deleted file mode 100644 (file)
index 846e059..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-SCREEN_GECHIC[name] ?= "HDMI-A-1"
-SCREEN_GECHIC[transform] ?= "270"
-# for 1080p on GeChic 1502i:
-SCREEN_GECHIC[mode] = "173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync"
-
-do_generate_weston_init[vardeps] += "SCREEN_GECHIC"
diff --git a/meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_dell.inc b/meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_dell.inc
deleted file mode 100644 (file)
index 9d41191..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-SCREEN_DELL[name]?="HDMI-A-1"
-SCREEN_DELL[transform]?="180"
-
-do_generate_weston_init[vardeps] += "SCREEN_DELL"
diff --git a/meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_eGalax.inc b/meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_eGalax.inc
deleted file mode 100644 (file)
index ecbba19..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-SCREEN_eGalax[name] ?= "HDMI-A-1"
-SCREEN_eGalax[transform] ?= "90"
-
-do_generate_weston_init[vardeps] += "SCREEN_eGalax"
diff --git a/meta-agl/recipes-graphics/wayland/weston-ini-conf/shell.cfg b/meta-agl/recipes-graphics/wayland/weston-ini-conf/shell.cfg
new file mode 100644 (file)
index 0000000..0567704
--- /dev/null
@@ -0,0 +1,3 @@
+[shell]
+locking=true
+panel-location=none