sysdeps/managarm: Implement CREATEPROPBLOB DRM ioctl
@@ -2710,6 +2710,35 @@ int sys_ioctl(int fd, unsigned long request, void *arg, int *result) {
*result = resp.result();
return 0;
}
+ case DRM_IOCTL_MODE_CREATEPROPBLOB: {
+ auto param = reinterpret_cast<drm_mode_create_blob *>(arg);
+
+ managarm::fs::CntRequest<MemoryAllocator> req(getSysdepsAllocator());
+ req.set_req_type(managarm::fs::CntReqType::PT_IOCTL);
+ req.set_command(request);
+ req.set_drm_blob_size(param->length);
+
+ auto [offer, send_req, blob_req, recv_resp] = exchangeMsgsSync(
+ handle,
+ helix_ng::offer(
+ helix_ng::sendBragiHeadOnly(req, getSysdepsAllocator()),
+ helix_ng::sendBuffer(reinterpret_cast<void *>(param->data), param->length),
+ helix_ng::recvInline())
+ );
+ HEL_CHECK(offer.error());
+ HEL_CHECK(send_req.error());
+ HEL_CHECK(blob_req.error());
+ HEL_CHECK(recv_resp.error());
+
+ managarm::fs::SvrResponse<MemoryAllocator> resp(getSysdepsAllocator());
+ resp.ParseFromArray(recv_resp.data(), recv_resp.length());
+ __ensure(resp.error() == managarm::fs::Errors::SUCCESS);
+
+ param->blob_id = resp.drm_blob_id();
+
+ *result = resp.result();
+ return 0;
+ }
case TCGETS: {
auto param = reinterpret_cast<struct termios *>(arg);
HelAction actions[4];
