libdrm has a way to unit-test the CS decoder: test_decode can decode a raw batch and compare it to a reference output. However, one still needs to genarate the raw, binary, batches to feed to test_decode. This couple of patches do exactly that. -- Damien