/** * 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 SetStandardCoefficient(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); LOG_DEBUG(Service_Y2R, "called standard_coefficient=%u", cmd_buff[1]); cmd_buff[1] = conversion.SetStandardCoefficient((StandardCoefficient)cmd_buff[1]).raw; }
static void SetStandardCoefficient(Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); u32 index = cmd_buff[1]; cmd_buff[0] = IPC::MakeHeader(0x20, 1, 0); cmd_buff[1] = conversion.SetStandardCoefficient((StandardCoefficient)index).raw; LOG_DEBUG(Service_Y2R, "called standard_coefficient=%u", index); }
/** * 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); }