Quantcast
Channel: PowerDevil activity
Viewing all articles
Browse latest Browse all 1903

Jakob Petsovits commented on merge request !374 at Plasma / PowerDevil

$
0
0

Struggling with 128 as a quasi-magic number. I guess anyone wanting to verify this needs to educate themselves on EDID on Wikipedia, as I just did, and learn that an EDID is at least 128 bytes long. Which also explains the hardcoded 128-byte array from ddcutil, which this code relies on.

I wonder if this can be presented in a more approachable manner. Not sure how exactly though, as sizeof(displayInfo->edid_bytes) relies on the fact that ddcutil defines it as byte array rather than byte pointer, and constexpr size_t EDID_MIN_SIZE = 128; implies that the size could be larger but the ddcutil byte array is always constant.

Perhaps an explanatory comment will do the best job?

Like,

// An EDID is at least 128 bytes long, ddcutil exposes the first 128 bytes.

Viewing all articles
Browse latest Browse all 1903

Trending Articles