1
0
mirror of https://github.com/libretro/Lakka-LibreELEC.git synced 2024-11-24 11:26:19 +00:00
Lakka-LibreELEC/projects/L4T/packages/busybox/scripts/dump-active-edids-drm
GavinDarkglider 47c07c60ba
[WIP]Lakka 5.x Switch changes..... (#1853)
* Latest 4.3 changes poorly merged

* Build fixes

* Squash?

* Fix ppsspp on switch

* Fix video recording, add base stuff for nvv4l2 decoder/encoder, but leave disabled for now

* Clean up left over files

* Switch: Dont build xpadneo driver, but install configs

* FFMpeg: Add back L4T decoder Patches
2023-06-10 03:16:27 +03:00

43 lines
937 B
Bash
Executable File

#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2021-present Team LibreELEC (https://libreelec.tv)
EDID_DIR="/storage/.config/firmware/edid"
CONNECTORS=""
if [ "$1" = "-q" ]; then
VERBOSE=0
else
VERBOSE=1
fi
info() {
[ "${VERBOSE}" = "1" ] && echo "$@"
}
mkdir -p "${EDID_DIR}"
for c in /sys/class/drm/card?-* ; do
[ ! -d "$c" ] && continue
[ ! -e "$c/status" ] && continue
if [ $(cat $c/status 2>/dev/null) = "connected" ]; then
CONNECTOR=$(basename $c | cut -c 7-)
EDID_NAME="edid-${CONNECTOR}.bin"
cat $c/edid > "${EDID_DIR}/${EDID_NAME}" 2>/dev/null
if [ $? -eq 0 ]; then
[ -n "${CONNECTORS}" ] && CONNECTORS="${CONNECTORS} "
CONNECTORS="${CONNECTORS}${CONNECTOR}"
fi
fi
done
if [ -z "${CONNECTORS}" ]; then
info "error: no active connectors found"
exit 1
else
info "found active connector(s) ${CONNECTORS}"
[ "${VERBOSE}" = "0" ] && echo "${CONNECTORS}"
fi