static void DriverInitialize(Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); conversion.input_format = InputFormat::YUV422_Indiv8; conversion.output_format = OutputFormat::RGBA8; conversion.rotation = Rotation::None; conversion.block_alignment = BlockAlignment::Linear; conversion.coefficients.fill(0); conversion.SetInputLineWidth(1024); conversion.SetInputLines(1024); conversion.alpha = 0; ConversionBuffer zero_buffer = {}; conversion.src_Y = zero_buffer; conversion.src_U = zero_buffer; conversion.src_V = zero_buffer; conversion.dst = zero_buffer; completion_event->Clear(); cmd_buff[0] = IPC::MakeHeader(0x2B, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; LOG_DEBUG(Service_Y2R, "called"); }
/** * Y2R_U::SetConversionParams service function */ static void SetConversionParams(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); auto params = reinterpret_cast<const ConversionParameters*>(&cmd_buff[1]); LOG_DEBUG(Service_Y2R, "called input_format=%hhu output_format=%hhu rotation=%hhu block_alignment=%hhu " "input_line_width=%hu input_lines=%hu standard_coefficient=%hhu " "reserved=%hhu alpha=%hX", params->input_format, params->output_format, params->rotation, params->block_alignment, params->input_line_width, params->input_lines, params->standard_coefficient, params->reserved, params->alpha); ResultCode result = RESULT_SUCCESS; conversion.input_format = params->input_format; conversion.output_format = params->output_format; conversion.rotation = params->rotation; conversion.block_alignment = params->block_alignment; result = conversion.SetInputLineWidth(params->input_line_width); if (result.IsError()) goto cleanup; result = conversion.SetInputLines(params->input_lines); if (result.IsError()) goto cleanup; result = conversion.SetStandardCoefficient(params->standard_coefficient); if (result.IsError()) goto cleanup; conversion.alpha = params->alpha; cleanup: cmd_buff[0] = 0x00290040; // TODO verify cmd_buff[1] = result.raw; }
static void SetInputLineWidth(Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); cmd_buff[0] = IPC::MakeHeader(0x1A, 1, 0); cmd_buff[1] = conversion.SetInputLineWidth(cmd_buff[1]).raw; LOG_DEBUG(Service_Y2R, "called input_line_width=%u", cmd_buff[1]); }
/** * Y2R_U::SetPackageParameter service function */ static void SetPackageParameter(Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); auto params = reinterpret_cast<const ConversionParameters*>(&cmd_buff[1]); conversion.input_format = params->input_format; conversion.output_format = params->output_format; conversion.rotation = params->rotation; conversion.block_alignment = params->block_alignment; ResultCode result = conversion.SetInputLineWidth(params->input_line_width); if (result.IsError()) goto cleanup; result = conversion.SetInputLines(params->input_lines); if (result.IsError()) goto cleanup; result = conversion.SetStandardCoefficient(params->standard_coefficient); if (result.IsError()) goto cleanup; conversion.padding = params->padding; conversion.alpha = params->alpha; cleanup: cmd_buff[0] = IPC::MakeHeader(0x29, 1, 0); cmd_buff[1] = result.raw; LOG_DEBUG( Service_Y2R, "called input_format=%hhu output_format=%hhu rotation=%hhu block_alignment=%hhu " "input_line_width=%hu input_lines=%hu standard_coefficient=%hhu reserved=%hhu alpha=%hX", params->input_format, params->output_format, params->rotation, params->block_alignment, params->input_line_width, params->input_lines, params->standard_coefficient, params->padding, params->alpha); }
static void SetInputLineWidth(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); LOG_DEBUG(Service_Y2R, "called input_line_width=%u", cmd_buff[1]); cmd_buff[1] = conversion.SetInputLineWidth(cmd_buff[1]).raw; }