aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-core
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-core')
-rw-r--r--meta-amd-bsp/recipes-core/busybox/busybox/gpt_disklabel.cfg1
-rw-r--r--meta-amd-bsp/recipes-core/busybox/busybox_%.bbappend4
-rw-r--r--meta-amd-bsp/recipes-core/initrdscripts/files/0001-init-install.sh-Don-t-set-quiet-kernel-option-in-ins.patch38
-rw-r--r--meta-amd-bsp/recipes-core/initrdscripts/files/0002-init-install.sh-Add-a-second-prompt-to-install.patch37
-rw-r--r--meta-amd-bsp/recipes-core/initrdscripts/files/0003-init-install-efi.sh-Don-t-set-quiet-kernel-option-in.patch38
-rw-r--r--meta-amd-bsp/recipes-core/initrdscripts/files/0004-init-install-efi.sh-Add-a-second-prompt-to-install.patch37
-rw-r--r--meta-amd-bsp/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bbappend5
-rw-r--r--meta-amd-bsp/recipes-core/initrdscripts/initramfs-live-install_1.0.bbappend5
-rw-r--r--meta-amd-bsp/recipes-core/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch115
-rw-r--r--meta-amd-bsp/recipes-core/llvm/llvm_git.bbappend19
-rw-r--r--meta-amd-bsp/recipes-core/packagegroups/packagegroup-multimedia-risky.bb14
-rw-r--r--meta-amd-bsp/recipes-core/systemd/systemd_%.bbappend7
-rw-r--r--meta-amd-bsp/recipes-core/udev/udev-extraconf/60-drm-hotplug-mode.rules1
-rw-r--r--meta-amd-bsp/recipes-core/udev/udev-extraconf/hotplug-display-auto.sh12
-rw-r--r--meta-amd-bsp/recipes-core/udev/udev-extraconf/hotplug-display-extended-h.sh16
-rw-r--r--meta-amd-bsp/recipes-core/udev/udev-extraconf/hotplug-display-extended-v.sh16
-rw-r--r--meta-amd-bsp/recipes-core/udev/udev-extraconf/hotplug-display-mirrored.sh16
-rw-r--r--meta-amd-bsp/recipes-core/udev/udev-extraconf_%.bbappend26
18 files changed, 407 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-core/busybox/busybox/gpt_disklabel.cfg b/meta-amd-bsp/recipes-core/busybox/busybox/gpt_disklabel.cfg
new file mode 100644
index 00000000..686eb99d
--- /dev/null
+++ b/meta-amd-bsp/recipes-core/busybox/busybox/gpt_disklabel.cfg
@@ -0,0 +1 @@
+CONFIG_FEATURE_GPT_LABEL=y
diff --git a/meta-amd-bsp/recipes-core/busybox/busybox_%.bbappend b/meta-amd-bsp/recipes-core/busybox/busybox_%.bbappend
new file mode 100644
index 00000000..e77c720e
--- /dev/null
+++ b/meta-amd-bsp/recipes-core/busybox/busybox_%.bbappend
@@ -0,0 +1,4 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+SRC_URI_append_amd = " \
+ file://gpt_disklabel.cfg \
+ "
diff --git a/meta-amd-bsp/recipes-core/initrdscripts/files/0001-init-install.sh-Don-t-set-quiet-kernel-option-in-ins.patch b/meta-amd-bsp/recipes-core/initrdscripts/files/0001-init-install.sh-Don-t-set-quiet-kernel-option-in-ins.patch
new file mode 100644
index 00000000..c42438d4
--- /dev/null
+++ b/meta-amd-bsp/recipes-core/initrdscripts/files/0001-init-install.sh-Don-t-set-quiet-kernel-option-in-ins.patch
@@ -0,0 +1,38 @@
+From 2fe5dc144c38ca4e8621d81e990453565bb1b01e Mon Sep 17 00:00:00 2001
+From: Awais Belal <awais_belal@mentor.com>
+Date: Mon, 19 Mar 2018 16:49:51 +0500
+Subject: [PATCH] init-install.sh: Don't set "quiet" kernel option
+
+Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
+Signed-off-by: Awais Belal <awais_belal@mentor.com>
+
+Upstream-Status: Inappropriate [configuration]
+---
+ init-install.sh | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/init-install.sh b/init-install.sh
+index 713a830..36fcdba 100644
+--- init-install.sh
++++ init-install.sh
+@@ -293,7 +293,7 @@ if [ -f /etc/grub.d/00_header -a $grub_version -ne 0 ] ; then
+ cat >$GRUBCFG <<_EOF
+ menuentry "Linux" {
+ search --no-floppy --fs-uuid $boot_uuid --set root
+- linux /$kernel root=PARTUUID=$root_part_uuid $rootwait rw $5 $3 $4 quiet
++ linux /$kernel root=PARTUUID=$root_part_uuid $rootwait rw $5 $3 $4
+ }
+ _EOF
+ chmod 0444 $GRUBCFG
+@@ -307,7 +307,7 @@ if [ $grub_version -eq 0 ] ; then
+ echo "timeout 30" >> /boot/grub/menu.lst
+ echo "title Live Boot/Install-Image" >> /boot/grub/menu.lst
+ echo "root (hd0,0)" >> /boot/grub/menu.lst
+- echo "kernel /$kernel root=$rootfs rw $3 $4 quiet" >> /boot/grub/menu.lst
++ echo "kernel /$kernel root=$rootfs rw $3 $4" >> /boot/grub/menu.lst
+ fi
+
+ # Copy kernel artifacts. To add more artifacts just add to types
+--
+2.11.1
+
diff --git a/meta-amd-bsp/recipes-core/initrdscripts/files/0002-init-install.sh-Add-a-second-prompt-to-install.patch b/meta-amd-bsp/recipes-core/initrdscripts/files/0002-init-install.sh-Add-a-second-prompt-to-install.patch
new file mode 100644
index 00000000..49482b52
--- /dev/null
+++ b/meta-amd-bsp/recipes-core/initrdscripts/files/0002-init-install.sh-Add-a-second-prompt-to-install.patch
@@ -0,0 +1,37 @@
+From b93b1271d5f548c048b0813e1f9662c0befdac97 Mon Sep 17 00:00:00 2001
+From: Drew Moseley <drew_moseley@mentor.com>
+Date: Sat, 5 Jul 2014 18:58:25 -0400
+Subject: [PATCH 2/4] init-install.sh: Add a second prompt to install
+
+This also makes it clear that the user will be overwriting
+the entire disk.
+
+Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
+---
+ meta/recipes-core/initrdscripts/files/init-install.sh | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+Upstream-Status: Inappropriate [configuration]
+
+diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh
+--- init-install.sh.orig 2016-08-01 13:29:03.823681411 -0700
++++ init-install.sh 2016-08-01 13:30:32.323680567 -0700
+@@ -94,6 +94,18 @@
+ done
+
+ if [ -n "$TARGET_DEVICE_NAME" ]; then
++ while true; do
++ echo "This will overwrite all data on $TARGET_DEVICE_NAME"
++ echo -n "Are you sure? [y/n] "
++ read answer
++ if [ "$answer" = "y" ]; then
++ break
++ elif [ "$answer" = "n" ]; then
++ echo "Installation aborted."
++ exit 1
++ fi
++ echo "Please answer y or n"
++ done
+ echo "Installing image on /dev/$TARGET_DEVICE_NAME ..."
+ else
+ echo "No hard drive selected. Installation aborted."
diff --git a/meta-amd-bsp/recipes-core/initrdscripts/files/0003-init-install-efi.sh-Don-t-set-quiet-kernel-option-in.patch b/meta-amd-bsp/recipes-core/initrdscripts/files/0003-init-install-efi.sh-Don-t-set-quiet-kernel-option-in.patch
new file mode 100644
index 00000000..76771c09
--- /dev/null
+++ b/meta-amd-bsp/recipes-core/initrdscripts/files/0003-init-install-efi.sh-Don-t-set-quiet-kernel-option-in.patch
@@ -0,0 +1,38 @@
+From 30186b183e0022abb97485f5804be0e1e02ccb1f Mon Sep 17 00:00:00 2001
+From: Awais Belal <awais_belal@mentor.com>
+Date: Mon, 19 Mar 2018 16:56:53 +0500
+Subject: [PATCH] init-install-efi.sh: Don't set "quiet" kernel option
+
+Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
+Signed-off-by: Awais Belal <awais_belal@mentor.com>
+
+Upstream-Status: Inappropriate [configuration]
+---
+ init-install-efi.sh | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/init-install-efi.sh b/init-install-efi.sh
+index f946d97..c8af835 100644
+--- init-install-efi.sh
++++ init-install-efi.sh
+@@ -246,7 +246,7 @@ if [ -f /run/media/$1/EFI/BOOT/grub.cfg ]; then
+ sed -i "s/ LABEL=[^ ]*/ /" $GRUBCFG
+ # Replace root= and add additional standard boot options
+ # We use root as a sentinel value, as vmlinuz is no longer guaranteed
+- sed -i "s/ root=[^ ]*/ root=PARTUUID=$root_part_uuid rw $rootwait quiet /g" $GRUBCFG
++ sed -i "s/ root=[^ ]*/ root=PARTUUID=$root_part_uuid rw $rootwait /g" $GRUBCFG
+ fi
+
+ if [ -d /run/media/$1/loader ]; then
+@@ -263,7 +263,7 @@ if [ -d /run/media/$1/loader ]; then
+ # delete any root= strings
+ sed -i "s/ root=[^ ]*/ /" $SYSTEMDBOOT_CFGS
+ # add the root= and other standard boot options
+- sed -i "s@options *@options root=PARTUUID=$rootuuid rw $rootwait quiet @" $SYSTEMDBOOT_CFGS
++ sed -i "s@options *@options root=PARTUUID=$rootuuid rw $rootwait @" $SYSTEMDBOOT_CFGS
+ fi
+
+ umount /tgt_root
+--
+2.11.1
+
diff --git a/meta-amd-bsp/recipes-core/initrdscripts/files/0004-init-install-efi.sh-Add-a-second-prompt-to-install.patch b/meta-amd-bsp/recipes-core/initrdscripts/files/0004-init-install-efi.sh-Add-a-second-prompt-to-install.patch
new file mode 100644
index 00000000..86b8baee
--- /dev/null
+++ b/meta-amd-bsp/recipes-core/initrdscripts/files/0004-init-install-efi.sh-Add-a-second-prompt-to-install.patch
@@ -0,0 +1,37 @@
+From a2c99e6a9b5a47f72a9a73ad5d1978786c809583 Mon Sep 17 00:00:00 2001
+From: Drew Moseley <drew_moseley@mentor.com>
+Date: Sat, 5 Jul 2014 18:58:39 -0400
+Subject: [PATCH 4/4] init-install-efi.sh: Add a second prompt to install
+
+This also makes it clear that the user will be overwriting
+the entire disk.
+
+Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
+---
+ meta/recipes-core/initrdscripts/files/init-install-efi.sh | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+Upstream-Status: Inappropriate [configuration]
+
+diff --git a/meta/recipes-core/initrdscripts/files/init-install-efi.sh b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
+--- init-install-efi.sh.orig 2016-08-02 12:13:24.718900725 -0700
++++ init-install-efi.sh 2016-08-02 12:16:05.926899187 -0700
+@@ -100,6 +100,18 @@
+ done
+
+ if [ -n "$TARGET_DEVICE_NAME" ]; then
++ while true; do
++ echo "This will overwrite all data on $TARGET_DEVICE_NAME"
++ echo -n "Are you sure? [y/n] "
++ read answer
++ if [ "$answer" = "y" ]; then
++ break
++ elif [ "$answer" = "n" ]; then
++ echo "Installation aborted."
++ exit 1
++ fi
++ echo "Please answer y or n"
++ done
+ echo "Installing image on /dev/$TARGET_DEVICE_NAME ..."
+ else
+ echo "No hard drive selected. Installation aborted."
diff --git a/meta-amd-bsp/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bbappend b/meta-amd-bsp/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bbappend
new file mode 100644
index 00000000..752982b5
--- /dev/null
+++ b/meta-amd-bsp/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bbappend
@@ -0,0 +1,5 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+SRC_URI_append_amd = " \
+ file://0003-init-install-efi.sh-Don-t-set-quiet-kernel-option-in.patch;striplevel=0;patchdir=${WORKDIR} \
+ file://0004-init-install-efi.sh-Add-a-second-prompt-to-install.patch;striplevel=0;patchdir=${WORKDIR} \
+"
diff --git a/meta-amd-bsp/recipes-core/initrdscripts/initramfs-live-install_1.0.bbappend b/meta-amd-bsp/recipes-core/initrdscripts/initramfs-live-install_1.0.bbappend
new file mode 100644
index 00000000..45ccedbd
--- /dev/null
+++ b/meta-amd-bsp/recipes-core/initrdscripts/initramfs-live-install_1.0.bbappend
@@ -0,0 +1,5 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+SRC_URI_append_amd = " \
+ file://0001-init-install.sh-Don-t-set-quiet-kernel-option-in-ins.patch;striplevel=0;patchdir=${WORKDIR} \
+ file://0002-init-install.sh-Add-a-second-prompt-to-install.patch;striplevel=0;patchdir=${WORKDIR} \
+"
diff --git a/meta-amd-bsp/recipes-core/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch b/meta-amd-bsp/recipes-core/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch
new file mode 100644
index 00000000..774947ae
--- /dev/null
+++ b/meta-amd-bsp/recipes-core/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch
@@ -0,0 +1,115 @@
+From 0570fe02c07244a8724c1e6c0437f893c8aa8e93 Mon Sep 17 00:00:00 2001
+From: Martin Kelly <mkelly@xevo.com>
+Date: Fri, 19 May 2017 00:22:57 -0700
+Subject: [PATCH 2/2] llvm: allow env override of exe path
+
+When using a native llvm-config from inside a sysroot, we need llvm-config to
+return the libraries, include directories, etc. from inside the sysroot rather
+than from the native sysroot. Thus provide an env override for calling
+llvm-config from a target sysroot.
+
+To let it work in multilib environment, we need to provide a knob to supply
+multilib dirname as well
+
+Upstream-Status: Inappropriate [OE-Specific]
+
+Signed-off-by: Martin Kelly <mkelly@xevo.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Arsalan H. Awan <Arsalan_Awan@mentor.com>
+---
+ tools/llvm-config/llvm-config.cpp | 35 ++++++++++++++++++++++---------
+ 1 file changed, 25 insertions(+), 10 deletions(-)
+
+diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
+index bec89fef98c..91b4d6e4c43 100644
+--- a/tools/llvm-config/llvm-config.cpp
++++ b/tools/llvm-config/llvm-config.cpp
+@@ -226,6 +226,13 @@ Typical components:\n\
+
+ /// Compute the path to the main executable.
+ std::string GetExecutablePath(const char *Argv0) {
++ // Hack for Yocto: we need to override the root path when we are using
++ // llvm-config from within a target sysroot.
++ const char *Sysroot = std::getenv("YOCTO_ALTERNATE_EXE_PATH");
++ if (Sysroot != nullptr) {
++ return Sysroot;
++ }
++
+ // This just needs to be some symbol in the binary; C++ doesn't
+ // allow taking the address of ::main however.
+ void *P = (void *)(intptr_t)GetExecutablePath;
+@@ -284,7 +291,7 @@ int main(int argc, char **argv) {
+ // bin dir).
+ sys::fs::make_absolute(CurrentPath);
+ CurrentExecPrefix =
+- sys::path::parent_path(sys::path::parent_path(CurrentPath)).str();
++ sys::path::parent_path(sys::path::parent_path(sys::path::parent_path(CurrentPath))).str();
+
+ // Check to see if we are inside a development tree by comparing to possible
+ // locations (prefix style or CMake style).
+@@ -293,7 +300,7 @@ int main(int argc, char **argv) {
+ DevelopmentTreeLayout = CMakeStyle;
+ ActiveObjRoot = LLVM_OBJ_ROOT;
+ } else if (sys::fs::equivalent(CurrentExecPrefix,
+- Twine(LLVM_OBJ_ROOT) + "/bin")) {
++ Twine(LLVM_OBJ_ROOT) + "/bin/llvm9.0.0")) {
+ IsInDevelopmentTree = true;
+ DevelopmentTreeLayout = CMakeBuildModeStyle;
+ ActiveObjRoot = LLVM_OBJ_ROOT;
+@@ -307,37 +314,45 @@ int main(int argc, char **argv) {
+ std::string ActivePrefix, ActiveBinDir, ActiveIncludeDir, ActiveLibDir,
+ ActiveCMakeDir;
+ std::string ActiveIncludeOption;
++ // Hack for Yocto: we need to override the multilib path when we are using
++ // llvm-config from within a target sysroot.
++ std::string Multilibdir = std::getenv("YOCTO_ALTERNATE_MULTILIB_NAME");
++ if (Multilibdir.empty()) {
++ Multilibdir = "/lib/llvm9.0.0" LLVM_LIBDIR_SUFFIX;
++ }
++
+ if (IsInDevelopmentTree) {
+- ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/include";
++ ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/include/llvm9.0.0";
+ ActivePrefix = CurrentExecPrefix;
+
+ // CMake organizes the products differently than a normal prefix style
+ // layout.
++
+ switch (DevelopmentTreeLayout) {
+ case CMakeStyle:
+- ActiveBinDir = ActiveObjRoot + "/bin";
+- ActiveLibDir = ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX;
++ ActiveBinDir = ActiveObjRoot + "/bin/llvm9.0.0";
++ ActiveLibDir = ActiveObjRoot + "/lib/llvm9.0.0" + LLVM_LIBDIR_SUFFIX;
+ ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
+ break;
+ case CMakeBuildModeStyle:
+ ActivePrefix = ActiveObjRoot;
+- ActiveBinDir = ActiveObjRoot + "/bin/" + build_mode;
++ ActiveBinDir = ActiveObjRoot + "/bin/llvm9.0.0/" + build_mode;
+ ActiveLibDir =
+- ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX + "/" + build_mode;
++ ActiveObjRoot + "/lib/llvm9.0.0" + LLVM_LIBDIR_SUFFIX + "/" + build_mode;
+ ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
+ break;
+ }
+
+ // We need to include files from both the source and object trees.
+ ActiveIncludeOption =
+- ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include");
++ ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include/llvm9.0.0");
+ } else {
+ ActivePrefix = CurrentExecPrefix;
+- ActiveIncludeDir = ActivePrefix + "/include";
++ ActiveIncludeDir = ActivePrefix + "/include/llvm9.0.0";
+ SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR));
+ sys::fs::make_absolute(ActivePrefix, path);
+ ActiveBinDir = path.str();
+- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
++ ActiveLibDir = ActivePrefix + Multilibdir;
+ ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
+ ActiveIncludeOption = "-I" + ActiveIncludeDir;
+ }
+--
+2.20.1
+
diff --git a/meta-amd-bsp/recipes-core/llvm/llvm_git.bbappend b/meta-amd-bsp/recipes-core/llvm/llvm_git.bbappend
new file mode 100644
index 00000000..cdd24559
--- /dev/null
+++ b/meta-amd-bsp/recipes-core/llvm/llvm_git.bbappend
@@ -0,0 +1,19 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=8a15a0759ef07f2682d2ba4b893c9afe"
+
+SRCREV = "b8d352a08bc6530a9de442af8f55649199481f1b"
+
+MAJOR_VERSION = "9"
+MINOR_VERSION = "0"
+PATCH_VERSION = "0"
+
+EXTRA_OECMAKE += "-DLLVM_VERSION_SUFFIX=''"
+
+PACKAGES =+ "${PN}-libremarks"
+
+FILES_${PN}-libremarks = "\
+ ${libdir}/${LLVM_DIR}/libRemarks.so* \
+"
+
+INSANE_SKIP_${PN}-libremarks += "dev-so"
diff --git a/meta-amd-bsp/recipes-core/packagegroups/packagegroup-multimedia-risky.bb b/meta-amd-bsp/recipes-core/packagegroups/packagegroup-multimedia-risky.bb
new file mode 100644
index 00000000..30e80467
--- /dev/null
+++ b/meta-amd-bsp/recipes-core/packagegroups/packagegroup-multimedia-risky.bb
@@ -0,0 +1,14 @@
+DESCRIPTION = "AMD risky multimedia packages"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+PR = "r0"
+
+inherit packagegroup
+
+RDEPENDS_${PN} += "\
+ faad2 \
+ libid3tag \
+ gstreamer1.0-plugins-bad-meta \
+ gstreamer1.0-plugins-ugly-meta \
+ gstreamer1.0-libav \
+"
diff --git a/meta-amd-bsp/recipes-core/systemd/systemd_%.bbappend b/meta-amd-bsp/recipes-core/systemd/systemd_%.bbappend
new file mode 100644
index 00000000..211fc0b0
--- /dev/null
+++ b/meta-amd-bsp/recipes-core/systemd/systemd_%.bbappend
@@ -0,0 +1,7 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+pkg_postinst_udev-hwdb_amd () {
+}
+pkg_postinst_ontarget_udev-hwdb_amd () {
+ udevadm hwdb --update
+}
diff --git a/meta-amd-bsp/recipes-core/udev/udev-extraconf/60-drm-hotplug-mode.rules b/meta-amd-bsp/recipes-core/udev/udev-extraconf/60-drm-hotplug-mode.rules
new file mode 100644
index 00000000..9eaa12ba
--- /dev/null
+++ b/meta-amd-bsp/recipes-core/udev/udev-extraconf/60-drm-hotplug-mode.rules
@@ -0,0 +1 @@
+ACTION=="change", SUBSYSTEM=="drm", ENV{HOTPLUG}=="1", ENV{DISPLAY}=":0", RUN+="/etc/udev/scripts/hotplug-display-@MULTIDISPLAYMODE.sh"
diff --git a/meta-amd-bsp/recipes-core/udev/udev-extraconf/hotplug-display-auto.sh b/meta-amd-bsp/recipes-core/udev/udev-extraconf/hotplug-display-auto.sh
new file mode 100644
index 00000000..9e1864da
--- /dev/null
+++ b/meta-amd-bsp/recipes-core/udev/udev-extraconf/hotplug-display-auto.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+connectedPorts=$(xrandr | grep " connected" | sed 's/ connected.*//')
+for port in $connectedPorts ; do
+ xrandr --output $port --auto
+done
+
+disconnectedPorts=$(xrandr | grep " disconnected" | sed 's/ disconnected.*//')
+for port in $disconnectedPorts ; do
+ xrandr --output $port --off
+done
+
diff --git a/meta-amd-bsp/recipes-core/udev/udev-extraconf/hotplug-display-extended-h.sh b/meta-amd-bsp/recipes-core/udev/udev-extraconf/hotplug-display-extended-h.sh
new file mode 100644
index 00000000..6adab773
--- /dev/null
+++ b/meta-amd-bsp/recipes-core/udev/udev-extraconf/hotplug-display-extended-h.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+declare -a connectedPorts=($(xrandr | grep " connected" | sed 's/ connected.*//'))
+for i in "${!connectedPorts[@]}"; do
+ if [ $i -eq 0 ]; then
+ xrandr --output ${connectedPorts[i]} --auto
+ fi
+ if [ -n "${connectedPorts[i+1]}" ]; then
+ xrandr --output ${connectedPorts[i+1]} --auto --right-of ${connectedPorts[i]}
+ fi
+done
+
+disconnectedPorts=$(xrandr | grep " disconnected" | sed 's/ disconnected.*//')
+for port in $disconnectedPorts ; do
+ xrandr --output $port --off
+done
diff --git a/meta-amd-bsp/recipes-core/udev/udev-extraconf/hotplug-display-extended-v.sh b/meta-amd-bsp/recipes-core/udev/udev-extraconf/hotplug-display-extended-v.sh
new file mode 100644
index 00000000..5b16969c
--- /dev/null
+++ b/meta-amd-bsp/recipes-core/udev/udev-extraconf/hotplug-display-extended-v.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+declare -a connectedPorts=($(xrandr | grep " connected" | sed 's/ connected.*//'))
+for i in "${!connectedPorts[@]}"; do
+ if [ $i -eq 0 ]; then
+ xrandr --output ${connectedPorts[i]} --auto
+ fi
+ if [ -n "${connectedPorts[i+1]}" ]; then
+ xrandr --output ${connectedPorts[i+1]} --auto --below ${connectedPorts[i]}
+ fi
+done
+
+disconnectedPorts=$(xrandr | grep " disconnected" | sed 's/ disconnected.*//')
+for port in $disconnectedPorts ; do
+ xrandr --output $port --off
+done
diff --git a/meta-amd-bsp/recipes-core/udev/udev-extraconf/hotplug-display-mirrored.sh b/meta-amd-bsp/recipes-core/udev/udev-extraconf/hotplug-display-mirrored.sh
new file mode 100644
index 00000000..1c0ae61a
--- /dev/null
+++ b/meta-amd-bsp/recipes-core/udev/udev-extraconf/hotplug-display-mirrored.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+declare -a connectedPorts=($(xrandr | grep " connected" | sed 's/ connected.*//'))
+for i in "${!connectedPorts[@]}"; do
+ if [ $i -eq 0 ]; then
+ xrandr --output ${connectedPorts[i]} --auto
+ fi
+ if [ -n "${connectedPorts[i+1]}" ]; then
+ xrandr --output ${connectedPorts[i+1]} --auto --same-as ${connectedPorts[0]}
+ fi
+done
+
+disconnectedPorts=$(xrandr | grep " disconnected" | sed 's/ disconnected.*//')
+for port in $disconnectedPorts ; do
+ xrandr --output $port --off
+done
diff --git a/meta-amd-bsp/recipes-core/udev/udev-extraconf_%.bbappend b/meta-amd-bsp/recipes-core/udev/udev-extraconf_%.bbappend
new file mode 100644
index 00000000..28e5e30f
--- /dev/null
+++ b/meta-amd-bsp/recipes-core/udev/udev-extraconf_%.bbappend
@@ -0,0 +1,26 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += " \
+ file://60-drm-hotplug-mode.rules \
+ file://hotplug-display-auto.sh \
+ file://hotplug-display-mirrored.sh \
+ file://hotplug-display-extended-h.sh \
+ file://hotplug-display-extended-v.sh \
+"
+# Allowed options for MULTI_DISPLAY_MODE: auto | mirrored | extended-h | extended-v
+MULTI_DISPLAY_MODE ?= "auto"
+
+do_install_append() {
+ sed -i 's/@MULTIDISPLAYMODE/${MULTI_DISPLAY_MODE}/' ${WORKDIR}/60-drm-hotplug-mode.rules
+
+ install -d ${D}${sysconfdir}/udev/rules.d
+ install -m 0644 ${WORKDIR}/60-drm-hotplug-mode.rules ${D}${sysconfdir}/udev/rules.d/60-drm-hotplug-mode.rules
+
+ install -d ${D}${sysconfdir}/udev/scripts/
+ install -m 0755 ${WORKDIR}/hotplug-display-auto.sh ${D}${sysconfdir}/udev/scripts/hotplug-display-auto.sh
+ install -m 0755 ${WORKDIR}/hotplug-display-mirrored.sh ${D}${sysconfdir}/udev/scripts/hotplug-display-mirrored.sh
+ install -m 0755 ${WORKDIR}/hotplug-display-extended-h.sh ${D}${sysconfdir}/udev/scripts/hotplug-display-extended-h.sh
+ install -m 0755 ${WORKDIR}/hotplug-display-extended-v.sh ${D}${sysconfdir}/udev/scripts/hotplug-display-extended-v.sh
+}
+
+RDEPENDS_${PN} += "${@bb.utils.contains('IMAGE_FEATURES', 'x11-base', 'xrandr', '', d)}"