summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author諏訪子 <suwako@076.moe>2024-06-19 16:32:14 +0900
committer諏訪子 <suwako@076.moe>2024-06-19 16:32:14 +0900
commit4090a27746074d7cf7ef72b0faa327bf295d8d98 (patch)
tree12b12dcc9178e1dfb9be7888a6b79f01a22a74d7
parent77aae06e6ce61ed2e8d67870195af6b892fd7529 (diff)
OpenBSD: サーバーでもGPU情報を確認する様に(現在Intelのみ)
-rw-r--r--src/gpu.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gpu.c b/src/gpu.c
index 3603861..76a43e8 100644
--- a/src/gpu.c
+++ b/src/gpu.c
@@ -41,7 +41,10 @@ const char *run_gpu_command(const char *command) {
}
const char *display_gpu() {
-#if defined(__FreeBSD__) || defined(__DragonFly__)
+#if defined(__OpenBSD__)
+ return run_gpu_command("dmesg | grep -i graphics | sed 's/^.* \"//' | "
+ "sed 's/\".*$//'");
+#elif defined(__FreeBSD__) || defined(__DragonFly__)
return run_gpu_command("pciconf -lv | grep -B 4 -F \"VGA\" | "
"grep -F \"device\" | sed 's/^.* device//' | "
"sed \"s/^.* '//\" | sed \"s/'//\" | tail -1 | "