Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RDKE-34 Add westeros to vendor layer #2

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions conf/layer.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"


BBFILES += "${LAYERDIR}/recipes-graphics/cairo/cairo_%.bbappend \
${LAYERDIR}/recipes-graphics/westeros/*.bbappend"

BBFILE_COLLECTIONS += "oss-vendor-raspberrypi"
BBFILE_PATTERN_oss-vendor-raspberrypi = "^${LAYERDIR}/"
Expand All @@ -10,4 +11,3 @@ BBFILE_PRIORITY_oss-vendor-raspberrypi = "6"
LAYERDEPENDS_oss-vendor-raspberrypi = "core"
LAYERSERIES_COMPAT_oss-vendor-raspberrypi = "dunfell"

BBFILES += "${LAYERDIR}/recipes-graphics/cairo/cairo_%.bbappend"
2 changes: 2 additions & 0 deletions recipes-graphics/westeros/westeros-simplebuffer.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Temporary until westeros.inc get updated to latest in common layer. Refer Comcast jira RDK-49476
include westeros.inc
2 changes: 2 additions & 0 deletions recipes-graphics/westeros/westeros-simpleshell.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Temporary until westeros.inc get updated to latest in common layer. Refer Comcast jira RDK-49476
include westeros.inc
2 changes: 2 additions & 0 deletions recipes-graphics/westeros/westeros-soc-drm.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Temporary until westeros.inc get updated to latest in common layer. Refer Comcast jira RDK-49476
include westeros.inc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

63 changes: 63 additions & 0 deletions recipes-graphics/westeros/westeros.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# bbappend for raspberryPi
#
include westeros.inc

PACKAGECONFIG = "incapp inctest increndergl incsbprotocol xdgv4"
PACKAGECONFIG_append = " ${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', 'modules', '', d)}"

# enable Linux DMA buffer for RPi4
PACKAGECONFIG_append_raspberrypi4 = " incldbprotocol"

CXXFLAGS_append = " ${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '-DWESTEROS_PLATFORM_DRM', '-DWESTEROS_PLATFORM_RPI -DWESTEROS_INVERTED_Y -DBUILD_WAYLAND -I${STAGING_INCDIR}/interface/vmcs_host/linux', d)} "
CXXFLAGS_append = " ${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '-DUSE_MESA', '', d)}"

inherit systemd update-rc.d

CXXFLAGS_append = "${@bb.utils.contains('DISTRO_FEATURES', 'enable_ermgr', ' -DUSE_ESSRMGR_UDS_IMPL', '', d)}"

do_configure_prepend () {
sed -i -e 's/-lwesteros_simplebuffer_client/-lwesteros_compositor -lwesteros_simplebuffer_client/g' ${S}/rpi/westeros-sink/Makefile.am
}

do_compile_prepend () {
export WESTEROS_COMPOSITOR_EXTRA_LIBS="${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '-lEGL -lGLESv2', '-lEGL -lGLESv2 -lbcm_host', d)}"
}

do_install_append () {

# install systemd services for auto start
if [ "${@bb.utils.contains("DISTRO_FEATURES", "systemd", "yes", "no", d)}" = "yes" ]; then
install -D -m 0644 ${S}/systemd/westeros.service ${D}${systemd_unitdir}/system/westeros.service
else
install -D -m 0755 ${S}/systemd/westeros.sysvinit ${D}${sysconfdir}/init.d/westeros
fi
install -D -m 0755 ${S}/systemd/westeros-init ${D}${bindir}/westeros-init

# Appending required environment variable for westeros
install -D -m 0644 ${S}/systemd/westeros-env ${D}${sysconfdir}/default/westeros-env

# defining environment variable for westeros
echo "XDG_RUNTIME_DIR=/run" >> ${D}${sysconfdir}/default/westeros-env
echo "WAYLAND_DISPLAY=wayland-0" >> ${D}${sysconfdir}/default/westeros-env

if [ "${@bb.utils.contains("DISTRO_FEATURES", "systemd", "yes", "no", d)}" = "yes" ]; then
sed -i '/Compositor/ a After=lircd.service lircd.socket' ${D}${systemd_unitdir}/system/westeros.service
fi
sed -i '/^exec/i MODULE=/usr/lib/libresolutionmodule.so.0.0.0' ${D}${bindir}/westeros-init
sed -i 's/$RENDERER/$RENDERER --module $MODULE/g' ${D}${bindir}/westeros-init
# westeros service is not required when RDK Shell is enabled
if [ "${@bb.utils.contains('DISTRO_FEATURES', 'rdkshell', 'yes', 'no', d)}" = "yes" ]; then
rm -rf ${D}${systemd_unitdir}
fi
}

do_install_append_rasberrypi4 () {
sed -i '/exec/i export WESTEROS_DRM_CARD=/dev/dri/card1' ${D}${bindir}/westeros-init
}

LDFLAGS_append = " ${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '', '-lvchostif', d)}"

INITSCRIPT_NAME = "westeros"
INITSCRIPT_PARAMS = "defaults"

SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'rdkshell', '', 'westeros.service', d)}"
16 changes: 16 additions & 0 deletions recipes-graphics/westeros/westeros.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#Temporary until westeros.inc get updated to latest in common layer. Refer Comcast jira RDK-49476
LICENSE = "Apache-2.0"

PV = "1.0+gitr${SRCPV}"

SRC_URI = "${WESTEROS_URI}"
SRCREV = "${WESTEROS_SRCREV}"

WESTEROS_URI ?= "${CMF_GIT_ROOT}/components/opensource/westeros;protocol=${CMF_GIT_PROTOCOL};branch=${CMF_GIT_MASTER_BRANCH};name=westeros"
# Tip of westeros master as of Mar 7, 2024
WESTEROS_SRCREV = "04c096cb3df0bc0797f5b6bc568e1d11b62dcb5b"

LICENSE_LOCATION ?= "${S}/LICENSE"
LIC_FILES_CHKSUM = "file://${LICENSE_LOCATION};md5=8fb65319802b0c15fc9e0835350ffa02"

SRCREV_FORMAT = "westeros"