Skip to content

Commit cec3263

Browse files
vunnysobrianmcgillion
authored andcommitted
graphics: Enable gpu passthrough
Pass "x-igd-opregion=on" deviceExtraArgs to graphics pci device which helps to enable opregion which in-turn enable access to video bios table (VBT) to gui-vm. So qemu will have access to display parameters which are needed in Link training for the Gen 12 eDP panel. Signed-off-by: Vunny Sodhi <vunny.sodhi@unikie.com>
1 parent d91c306 commit cec3263

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

modules/hardware/common/devices.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ in
5252
microvm.devices = mkForce (
5353
builtins.map (d: {
5454
bus = "pci";
55-
inherit (d) path;
55+
inherit (d) path qemu;
5656
}) config.ghaf.hardware.definition.gpu.pciDevices
5757
);
5858
ghaf.hardware.definition.gpu.pciDevices = config.ghaf.hardware.definition.gpu.pciDevices;

modules/hardware/definition.nix

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ in
4141
PCI device name (optional)
4242
'';
4343
};
44+
qemu.deviceExtraArgs = mkOption {
45+
type = types.nullOr types.str;
46+
default = null;
47+
description = ''
48+
Device additional arguments (optional)
49+
'';
50+
};
4451
};
4552
};
4653

@@ -255,6 +262,7 @@ in
255262
path = "0000:00:02.0";
256263
vendorId = "8086";
257264
productId = "a7a1";
265+
qemu.deviceExtraArgs = "x-igd-opregion=on"
258266
}]
259267
'';
260268
};

modules/reference/hardware/lenovo-x1/definitions/x1-gen12.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
path = "0000:00:02.0";
7979
vendorId = "8086";
8080
productId = "7d45";
81+
qemu.deviceExtraArgs = "x-igd-opregion=on";
8182
}
8283
{
8384
# Communication controller [0780]: Intel Corporation Device [8086:7e70] (rev 20)

0 commit comments

Comments
 (0)