Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
15 changes: 15 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace]
members = ["src/libkrun"]
members = ["src/libkrun", "src/krun_input"]
exclude = ["examples/gtk_display"]
resolver = "2"

Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
LIBRARY_HEADER = include/libkrun.h
LIBRARY_HEADER_DISPLAY = include/libkrun_display.h
LIBRARY_HEADER_INPUT = include/libkrun_input.h

ABI_VERSION=1
FULL_VERSION=1.15.1
Expand Down Expand Up @@ -58,6 +59,9 @@ endif
ifeq ($(SND),1)
FEATURE_FLAGS += --features snd
endif
ifeq ($(INPUT),1)
FEATURE_FLAGS += --features input
endif
ifeq ($(NITRO),1)
VARIANT = -nitro
FEATURE_FLAGS := --features nitro
Expand Down Expand Up @@ -147,6 +151,7 @@ install: libkrun.pc
install -d $(DESTDIR)$(PREFIX)/include
install -m 644 $(LIBRARY_HEADER) $(DESTDIR)$(PREFIX)/include
install -m 644 $(LIBRARY_HEADER_DISPLAY) $(DESTDIR)$(PREFIX)/include
install -m 644 $(LIBRARY_HEADER_INPUT) $(DESTDIR)$(PREFIX)/include
install -m 644 libkrun.pc $(DESTDIR)$(PREFIX)/$(LIBDIR_$(OS))/pkgconfig
install -m 755 $(LIBRARY_RELEASE_$(OS)) $(DESTDIR)$(PREFIX)/$(LIBDIR_$(OS))/
cd $(DESTDIR)$(PREFIX)/$(LIBDIR_$(OS))/ ; ln -sf $(KRUN_BINARY_$(OS)) $(KRUN_SONAME_$(OS)) ; ln -sf $(KRUN_SONAME_$(OS)) $(KRUN_BASE_$(OS))
Expand Down
17 changes: 17 additions & 0 deletions include/libkrun.h
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,23 @@ int32_t krun_display_set_refresh_rate(uint32_t ctx_id, uint32_t display_id, uint
*/
int32_t krun_set_display_backend(uint32_t ctx_id, const void *display_backend, size_t backend_size);


/**
* Adds an input device with separate config and events objects.
*
* Arguments:
* "ctx_id" - the configuration context ID
* "config_backend" - Pointer to a krun_input_config struct
* "config_backend_size" - sizeof() the krun_input_config struct
* "events_backend" - Pointer to a krun_input_event_provider struct
* "events_backend_size" - sizeof() the krun_input_event_provider struct
*
* Returns:
* Zero on success or a negative error code otherwise.
*/
int krun_add_input_device(uint32_t ctx_id, const void *config_backend, size_t config_backend_size,
const void *events_backend, size_t events_backend_size);

/**
* Enables or disables a virtio-snd device.
*
Expand Down
1 change: 1 addition & 0 deletions include/libkrun_input.h
2 changes: 2 additions & 0 deletions src/devices/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ blk = []
efi = ["blk", "net"]
gpu = ["rutabaga_gfx", "thiserror", "zerocopy", "krun_display"]
snd = ["pw", "thiserror"]
input = ["zerocopy", "krun_input"]
virgl_resource_map2 = []
nitro = []
test_utils = []
Expand All @@ -31,6 +32,7 @@ virtio-bindings = "0.2.0"
vm-memory = { version = ">=0.13", features = ["backend-mmap"] }
zerocopy = { version = "0.8.26", optional = true, features = ["derive"] }
krun_display = { path = "../krun_display", optional = true, features = ["bindgen_clang_runtime"] }
krun_input = { path = "../krun_input", features = ["bindgen_clang_runtime"], optional = true }

arch = { path = "../arch" }
utils = { path = "../utils" }
Expand Down
Loading