mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
backend/drm: use pnp.ids to fetch EDID data
This commit is contained in:
parent
d75b4d8e86
commit
eec95e3d5e
8 changed files with 63 additions and 77 deletions
27
backend/drm/gen_pnpids.sh
Executable file
27
backend/drm/gen_pnpids.sh
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/bin/sh -eu
|
||||
#
|
||||
# usage: gen_pnpids.sh < pnp.ids > pnpids.c
|
||||
|
||||
gen_pnps()
|
||||
{
|
||||
while read -r id vendor; do
|
||||
[ "${#id}" = 3 ] || exit 1
|
||||
|
||||
printf "\tcase PNP_ID('%c', '%c', '%c'): return \"%s\";\n" \
|
||||
"$id" "${id#?}" "${id#??}" "$vendor"
|
||||
done
|
||||
}
|
||||
|
||||
cat << EOF
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include "backend/drm/util.h"
|
||||
#define PNP_ID(a, b, c) ((a & 0x1f) << 10) | ((b & 0x1f) << 5) | (c & 0x1f)
|
||||
const char *get_pnp_manufacturer(uint16_t code) {
|
||||
switch (code) {
|
||||
$(gen_pnps)
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
#undef PNP_ID
|
||||
EOF
|
||||
Loading…
Add table
Add a link
Reference in a new issue