File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -23,22 +23,27 @@ pub fn main() !void {
2323 const encoder = node .getEncoder (connector .encoderId ) catch null ;
2424
2525 if (connector .props ()) | props | {
26- for (props ) | propId | {
26+ const propValues = connector .propValues ().? ;
27+
28+ for (props , 0.. ) | propId , i | {
29+ const propValueId = propValues [i ];
30+
2731 var prop : libdrm.types.ModeGetProperty = .{
2832 .propId = propId ,
2933 };
3034 try prop .getAllocated (node .fd , alloc );
3135 defer prop .deinit (alloc );
3236
33- if (prop .blobs ()) | blobs | {
34- for (blobs ) | blobId | {
35- var blob : libdrm.types.ModeGetBlob = .{
36- .blobId = blobId ,
37- };
38- try blob .getAllocated (node .fd , alloc );
37+ if (prop .flags .blob == 1 ) {
38+ var blob : libdrm.types.ModeGetBlob = .{
39+ .blobId = @intCast (propValueId ),
40+ };
41+ if (blob .getAllocated (node .fd , alloc )) {
3942 defer blob .deinit (alloc );
4043
4144 std .debug .print ("{}\n " , .{blob });
45+ } else | err | {
46+ std .debug .print ("{s}\n " , .{@errorName (err )});
4247 }
4348 }
4449
You can’t perform that action at this time.
0 commit comments