summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPancakeTAS <pancake@mgnet.work>2026-05-18 10:44:38 +0200
committerPancakeTAS <pancake@mgnet.work>2026-05-18 10:44:38 +0200
commit26e1631e4191bf8ec0a33a63327807686e78cbc0 (patch)
tree6c064d732035975c6ce696139fcb1693a9e1171b
Initial commit
-rw-r--r--.clang-tidy34
-rw-r--r--.gitignore14
-rw-r--r--CMakeLists.txt47
-rw-r--r--LICENSE.md7
4 files changed, 102 insertions, 0 deletions
diff --git a/.clang-tidy b/.clang-tidy
new file mode 100644
index 0000000..8044098
--- /dev/null
+++ b/.clang-tidy
@@ -0,0 +1,34 @@
+UseColor: true
+Checks:
+# COMMON: Usually, we keep all checks enabled
+- "bugprone-*"
+- "clang-analyzer-*"
+- "cppcoreguidelines-*"
+- "misc-*"
+- "modernize-*"
+- "performance-*"
+- "portability-*"
+- "readability-*"
+# COMMON: Some checks related purely to code-style are disabled
+- -modernize-use-designated-initializers
+- -modernize-use-trailing-return-type
+- -modernize-deprecated-headers
+- -readability-function-cognitive-complexity
+- -readability-math-missing-parentheses
+- -readability-braces-around-statements
+- -readability-implicit-bool-conversion
+- -readability-identifier-length
+- -readability-magic-numbers
+- -cppcoreguidelines-avoid-magic-numbers
+- -cppcoreguidelines-macro-usage
+- -bugprone-easily-swappable-parameters
+- -portability-avoid-pragma-once
+# Various checks that interfere with C-to-C++ style code are disabled
+- -cppcoreguidelines-pro-bounds-pointer-arithmetic
+- -cppcoreguidelines-pro-type-reinterpret-cast
+- -cppcoreguidelines-pro-type-vararg
+- -cppcoreguidelines-avoid-c-arrays
+- -cppcoreguidelines-owning-memory
+- -bugprone-macro-parentheses
+- -modernize-avoid-c-arrays
+- -performance-enum-size
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..a57e673
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+# Kernel UAPI Files
+/uapi
+
+# CMake Build Files
+/build
+/.cache
+
+# Various IDEs
+/.zed
+/.vscode
+
+# LSPs, etc.
+/.clangd
+/.ccls
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..8ac3bd8
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,47 @@
+cmake_minimum_required(VERSION 4.0)
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
+
+project(drm++ LANGUAGES CXX)
+
+set(CMAKE_CXX_STANDARD 20)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_VISIBILITY_PRESET hidden)
+
+set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+set(CMAKE_SKIP_RPATH ON)
+
+if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
+ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+ message(STATUS "Building with clang-specific diagnostics")
+
+ set(CMAKE_CXX_CLANG_TIDY clang-tidy) # See .clang-tidy files
+
+ add_compile_options(
+ # By default, enable all warnings
+ -Weverything
+ # Some warnings are incompatible with each other
+ -Wno-pre-c++20-compat-pedantic
+ -Wno-c++98-compat-pedantic
+ -Wno-switch-default
+ # Then there's code-style things I don't care about
+ -Wno-missing-designated-field-initializers
+ -Wno-shadow
+ # And functional warning I don't care about either
+ -Wno-cast-function-type-strict
+ -Wno-padded
+ # Due to C/C++ interop
+ -Wno-unsafe-buffer-usage
+ )
+ endif()
+endif()
+
+set(SOURCES
+ "src/priv/ioctl.cpp"
+ "src/syncobject.cpp"
+ "src/main.cpp")
+
+add_executable(drm++ ${SOURCES})
+target_include_directories(drm++ PUBLIC include)
+target_include_directories(drm++ SYSTEM PRIVATE uapi)
diff --git a/LICENSE.md b/LICENSE.md
new file mode 100644
index 0000000..0431549
--- /dev/null
+++ b/LICENSE.md
@@ -0,0 +1,7 @@
+Copyright (c) 2026 PancakeTAS
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.