if (!gsc || !xe_uc_fw_is_enabled(&gsc->fw)) {
drm_dbg_kms(&xe->drm, "GSC Components not ready for HDCP2.x\n"); returnfalse;
}
xe_pm_runtime_get(xe);
fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GSC); if (!fw_ref) {
drm_dbg_kms(&xe->drm, "failed to get forcewake to check proxy status\n");
ret = false; goto out;
}
/*This function helps allocate memory for the command that we will send to gsc cs */ staticint intel_hdcp_gsc_initialize_message(struct xe_device *xe, struct intel_hdcp_gsc_context *gsc_context)
{ struct xe_bo *bo = NULL;
u64 cmd_in, cmd_out; int ret = 0;
/* allocate object of two page for HDCP command memory and store it */
bo = xe_bo_create_pin_map(xe, xe_device_get_root_tile(xe), NULL, PAGE_SIZE * 2,
ttm_bo_type_kernel,
XE_BO_FLAG_SYSTEM |
XE_BO_FLAG_GGTT);
if (IS_ERR(bo)) {
drm_err(&xe->drm, "Failed to allocate bo for HDCP streaming command!\n");
ret = PTR_ERR(bo); goto out;
}
gsc_context = kzalloc(sizeof(*gsc_context), GFP_KERNEL); if (!gsc_context) return ERR_PTR(-ENOMEM);
/* * NOTE: No need to lock the comp mutex here as it is already * going to be taken before this function called
*/
ret = intel_hdcp_gsc_initialize_message(xe, gsc_context); if (ret) {
drm_err(&xe->drm, "Could not initialize gsc_context\n");
kfree(gsc_context);
gsc_context = ERR_PTR(ret);
}
return gsc_context;
}
void intel_hdcp_gsc_context_free(struct intel_hdcp_gsc_context *gsc_context)
{ if (!gsc_context) return;
host_session_id = xe_gsc_create_host_session_id();
xe_pm_runtime_get_noresume(xe);
addr_in_wr_off = xe_gsc_emit_header(xe, &gsc_context->hdcp_bo->vmap,
addr_in_wr_off, HECI_MEADDRESS_HDCP,
host_session_id, msg_in_len);
xe_map_memcpy_to(xe, &gsc_context->hdcp_bo->vmap, addr_in_wr_off,
msg_in, msg_in_len); /* * Keep sending request in case the pending bit is set no need to add * message handle as we are using same address hence loc. of header is * same and it will contain the message handle. we will send the message * 20 times each message 50 ms apart
*/ do {
ret = xe_gsc_send_sync(xe, gsc_context, msg_size_in, msg_size_out,
addr_out_off);
/* Only try again if gsc says so */ if (ret != -EAGAIN) break;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.