mirror of
https://github.com/PabloMK7/citra.git
synced 2025-10-11 20:10:03 +00:00
kernel: Update to use atmosphere macros and correct Result (#7242)
* kernel: Switch to atmosphere style macros * code: Rename ResultCode to Result * code: Result constants are lower case * Address review comments * core: Remove CASCADE_CODE * R_TRY replaces completely * core: Run clang format
This commit is contained in:
parent
811303ea54
commit
5a7f615da1
132 changed files with 2807 additions and 2995 deletions
|
@ -77,10 +77,10 @@ constexpr std::array<int, 13> LATENCY_BY_FRAME_RATE{{
|
|||
33, // Rate_30_To_10
|
||||
}};
|
||||
|
||||
const ResultCode ERROR_INVALID_ENUM_VALUE(ErrorDescription::InvalidEnumValue, ErrorModule::CAM,
|
||||
ErrorSummary::InvalidArgument, ErrorLevel::Usage);
|
||||
const ResultCode ERROR_OUT_OF_RANGE(ErrorDescription::OutOfRange, ErrorModule::CAM,
|
||||
ErrorSummary::InvalidArgument, ErrorLevel::Usage);
|
||||
const Result ERROR_INVALID_ENUM_VALUE(ErrorDescription::InvalidEnumValue, ErrorModule::CAM,
|
||||
ErrorSummary::InvalidArgument, ErrorLevel::Usage);
|
||||
const Result ERROR_OUT_OF_RANGE(ErrorDescription::OutOfRange, ErrorModule::CAM,
|
||||
ErrorSummary::InvalidArgument, ErrorLevel::Usage);
|
||||
|
||||
void Module::PortConfig::Clear() {
|
||||
completion_event->Clear();
|
||||
|
@ -278,7 +278,7 @@ void Module::Interface::StartCapture(Kernel::HLERequestContext& ctx) {
|
|||
LOG_WARNING(Service_CAM, "port {} already started", i);
|
||||
}
|
||||
}
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
} else {
|
||||
LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val);
|
||||
rb.Push(ERROR_INVALID_ENUM_VALUE);
|
||||
|
@ -303,7 +303,7 @@ void Module::Interface::StopCapture(Kernel::HLERequestContext& ctx) {
|
|||
LOG_WARNING(Service_CAM, "port {} already stopped", i);
|
||||
}
|
||||
}
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
} else {
|
||||
LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val);
|
||||
rb.Push(ERROR_INVALID_ENUM_VALUE);
|
||||
|
@ -324,7 +324,7 @@ void Module::Interface::IsBusy(Kernel::HLERequestContext& ctx) {
|
|||
for (int i : port_select) {
|
||||
is_busy &= cam->ports[i].is_busy;
|
||||
}
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(is_busy);
|
||||
} else {
|
||||
LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val);
|
||||
|
@ -340,7 +340,7 @@ void Module::Interface::ClearBuffer(Kernel::HLERequestContext& ctx) {
|
|||
const PortSet port_select(rp.Pop<u8>());
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
LOG_WARNING(Service_CAM, "(STUBBED) called, port_select={}", port_select.m_val);
|
||||
}
|
||||
|
@ -352,7 +352,7 @@ void Module::Interface::GetVsyncInterruptEvent(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 2);
|
||||
if (port_select.IsSingle()) {
|
||||
int port = *port_select.begin();
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushCopyObjects(cam->ports[port].vsync_interrupt_event);
|
||||
} else {
|
||||
LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val);
|
||||
|
@ -370,7 +370,7 @@ void Module::Interface::GetBufferErrorInterruptEvent(Kernel::HLERequestContext&
|
|||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 2);
|
||||
if (port_select.IsSingle()) {
|
||||
int port = *port_select.begin();
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushCopyObjects(cam->ports[port].buffer_error_interrupt_event);
|
||||
} else {
|
||||
LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val);
|
||||
|
@ -405,7 +405,7 @@ void Module::Interface::SetReceiving(Kernel::HLERequestContext& ctx) {
|
|||
port.is_pending_receiving = true;
|
||||
}
|
||||
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushCopyObjects(port.completion_event);
|
||||
} else {
|
||||
LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val);
|
||||
|
@ -425,7 +425,7 @@ void Module::Interface::IsFinishedReceiving(Kernel::HLERequestContext& ctx) {
|
|||
if (port_select.IsSingle()) {
|
||||
int port = *port_select.begin();
|
||||
bool is_busy = cam->ports[port].is_receiving || cam->ports[port].is_pending_receiving;
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(!is_busy);
|
||||
} else {
|
||||
LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val);
|
||||
|
@ -448,7 +448,7 @@ void Module::Interface::SetTransferLines(Kernel::HLERequestContext& ctx) {
|
|||
for (int i : port_select) {
|
||||
cam->ports[i].transfer_bytes = transfer_lines * width * 2;
|
||||
}
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
} else {
|
||||
LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val);
|
||||
rb.Push(ERROR_INVALID_ENUM_VALUE);
|
||||
|
@ -476,7 +476,7 @@ void Module::Interface::GetMaxLines(Kernel::HLERequestContext& ctx) {
|
|||
if (lines > height) {
|
||||
lines = height;
|
||||
}
|
||||
ResultCode result = RESULT_SUCCESS;
|
||||
Result result = ResultSuccess;
|
||||
while (height % lines != 0 || (lines * width * 2 % MIN_TRANSFER_UNIT != 0)) {
|
||||
--lines;
|
||||
if (lines == 0) {
|
||||
|
@ -503,7 +503,7 @@ void Module::Interface::SetTransferBytes(Kernel::HLERequestContext& ctx) {
|
|||
for (int i : port_select) {
|
||||
cam->ports[i].transfer_bytes = transfer_bytes;
|
||||
}
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
} else {
|
||||
LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val);
|
||||
rb.Push(ERROR_INVALID_ENUM_VALUE);
|
||||
|
@ -520,7 +520,7 @@ void Module::Interface::GetTransferBytes(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
|
||||
if (port_select.IsSingle()) {
|
||||
int port = *port_select.begin();
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(cam->ports[port].transfer_bytes);
|
||||
} else {
|
||||
LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val);
|
||||
|
@ -551,7 +551,7 @@ void Module::Interface::GetMaxBytes(Kernel::HLERequestContext& ctx) {
|
|||
bytes -= MIN_TRANSFER_UNIT;
|
||||
}
|
||||
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(bytes);
|
||||
}
|
||||
|
||||
|
@ -568,7 +568,7 @@ void Module::Interface::SetTrimming(Kernel::HLERequestContext& ctx) {
|
|||
for (int i : port_select) {
|
||||
cam->ports[i].is_trimming = trim;
|
||||
}
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
} else {
|
||||
LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val);
|
||||
rb.Push(ERROR_INVALID_ENUM_VALUE);
|
||||
|
@ -584,7 +584,7 @@ void Module::Interface::IsTrimming(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
|
||||
if (port_select.IsSingle()) {
|
||||
int port = *port_select.begin();
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(cam->ports[port].is_trimming);
|
||||
} else {
|
||||
LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val);
|
||||
|
@ -611,7 +611,7 @@ void Module::Interface::SetTrimmingParams(Kernel::HLERequestContext& ctx) {
|
|||
cam->ports[i].x1 = x1;
|
||||
cam->ports[i].y1 = y1;
|
||||
}
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
} else {
|
||||
LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val);
|
||||
rb.Push(ERROR_INVALID_ENUM_VALUE);
|
||||
|
@ -628,7 +628,7 @@ void Module::Interface::GetTrimmingParams(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestBuilder rb = rp.MakeBuilder(5, 0);
|
||||
if (port_select.IsSingle()) {
|
||||
int port = *port_select.begin();
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(cam->ports[port].x0);
|
||||
rb.Push(cam->ports[port].y0);
|
||||
rb.Push(cam->ports[port].x1);
|
||||
|
@ -658,7 +658,7 @@ void Module::Interface::SetTrimmingParamsCenter(Kernel::HLERequestContext& ctx)
|
|||
cam->ports[i].x1 = cam->ports[i].x0 + trim_w;
|
||||
cam->ports[i].y1 = cam->ports[i].y0 + trim_h;
|
||||
}
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
} else {
|
||||
LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val);
|
||||
rb.Push(ERROR_INVALID_ENUM_VALUE);
|
||||
|
@ -684,7 +684,7 @@ void Module::Interface::Activate(Kernel::HLERequestContext& ctx) {
|
|||
cam->ports[i].is_active = false;
|
||||
cam->system.CoreTiming().UnscheduleEvent(cam->vsync_interrupt_event_callback, i);
|
||||
}
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
} else if (camera_select[0] && camera_select[1]) {
|
||||
LOG_ERROR(Service_CAM, "camera 0 and 1 can't be both activated");
|
||||
rb.Push(ERROR_INVALID_ENUM_VALUE);
|
||||
|
@ -698,7 +698,7 @@ void Module::Interface::Activate(Kernel::HLERequestContext& ctx) {
|
|||
if (camera_select[2]) {
|
||||
cam->ActivatePort(1, 2);
|
||||
}
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
} else {
|
||||
LOG_ERROR(Service_CAM, "invalid camera_select={}", camera_select.m_val);
|
||||
|
@ -724,7 +724,7 @@ void Module::Interface::SwitchContext(Kernel::HLERequestContext& ctx) {
|
|||
cam->cameras[camera].impl->SetFormat(context_config.format);
|
||||
cam->cameras[camera].impl->SetResolution(context_config.resolution);
|
||||
}
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
} else {
|
||||
LOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", camera_select.m_val,
|
||||
context_select.m_val);
|
||||
|
@ -751,7 +751,7 @@ void Module::Interface::FlipImage(Kernel::HLERequestContext& ctx) {
|
|||
}
|
||||
}
|
||||
}
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
} else {
|
||||
LOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", camera_select.m_val,
|
||||
context_select.m_val);
|
||||
|
@ -784,7 +784,7 @@ void Module::Interface::SetDetailSize(Kernel::HLERequestContext& ctx) {
|
|||
}
|
||||
}
|
||||
}
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
} else {
|
||||
LOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", camera_select.m_val,
|
||||
context_select.m_val);
|
||||
|
@ -814,7 +814,7 @@ void Module::Interface::SetSize(Kernel::HLERequestContext& ctx) {
|
|||
}
|
||||
}
|
||||
}
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
} else {
|
||||
LOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", camera_select.m_val,
|
||||
context_select.m_val);
|
||||
|
@ -836,7 +836,7 @@ void Module::Interface::SetFrameRate(Kernel::HLERequestContext& ctx) {
|
|||
cam->cameras[camera].frame_rate = frame_rate;
|
||||
cam->cameras[camera].impl->SetFrameRate(frame_rate);
|
||||
}
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
} else {
|
||||
LOG_ERROR(Service_CAM, "invalid camera_select={}", camera_select.m_val);
|
||||
rb.Push(ERROR_INVALID_ENUM_VALUE);
|
||||
|
@ -862,7 +862,7 @@ void Module::Interface::SetEffect(Kernel::HLERequestContext& ctx) {
|
|||
}
|
||||
}
|
||||
}
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
} else {
|
||||
LOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", camera_select.m_val,
|
||||
context_select.m_val);
|
||||
|
@ -889,7 +889,7 @@ void Module::Interface::SetOutputFormat(Kernel::HLERequestContext& ctx) {
|
|||
}
|
||||
}
|
||||
}
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
} else {
|
||||
LOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", camera_select.m_val,
|
||||
context_select.m_val);
|
||||
|
@ -906,7 +906,7 @@ void Module::Interface::SynchronizeVsyncTiming(Kernel::HLERequestContext& ctx) {
|
|||
const u8 camera_select2 = rp.Pop<u8>();
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
LOG_WARNING(Service_CAM, "(STUBBED) called, camera_select1={}, camera_select2={}",
|
||||
camera_select1, camera_select2);
|
||||
|
@ -925,7 +925,7 @@ void Module::Interface::GetLatestVsyncTiming(Kernel::HLERequestContext& ctx) {
|
|||
}
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 2);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
const std::size_t port_id = port_select.m_val == 1 ? 0 : 1;
|
||||
std::vector<u8> out(count * sizeof(s64_le));
|
||||
|
@ -961,7 +961,7 @@ void Module::Interface::GetStereoCameraCalibrationData(Kernel::HLERequestContext
|
|||
data.imageWidth = 640;
|
||||
data.imageHeight = 480;
|
||||
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushRaw(data);
|
||||
|
||||
LOG_TRACE(Service_CAM, "called");
|
||||
|
@ -974,13 +974,13 @@ void Module::Interface::SetPackageParameterWithoutContext(Kernel::HLERequestCont
|
|||
rp.PopRaw(package);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
LOG_WARNING(Service_CAM, "(STUBBED) called");
|
||||
}
|
||||
|
||||
template <typename PackageParameterType>
|
||||
ResultCode Module::SetPackageParameter(const PackageParameterType& package) {
|
||||
Result Module::SetPackageParameter(const PackageParameterType& package) {
|
||||
const CameraSet camera_select(package.camera_select);
|
||||
const ContextSet context_select(package.context_select);
|
||||
|
||||
|
@ -999,7 +999,7 @@ ResultCode Module::SetPackageParameter(const PackageParameterType& package) {
|
|||
}
|
||||
}
|
||||
}
|
||||
return RESULT_SUCCESS;
|
||||
return ResultSuccess;
|
||||
} else {
|
||||
LOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", package.camera_select,
|
||||
package.context_select);
|
||||
|
@ -1018,7 +1018,7 @@ void Module::Interface::SetPackageParameterWithContext(Kernel::HLERequestContext
|
|||
rp.PopRaw(package);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
ResultCode result = cam->SetPackageParameter(package);
|
||||
Result result = cam->SetPackageParameter(package);
|
||||
rb.Push(result);
|
||||
|
||||
LOG_DEBUG(Service_CAM, "called");
|
||||
|
@ -1031,7 +1031,7 @@ void Module::Interface::SetPackageParameterWithContextDetail(Kernel::HLERequestC
|
|||
rp.PopRaw(package);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
ResultCode result = cam->SetPackageParameter(package);
|
||||
Result result = cam->SetPackageParameter(package);
|
||||
rb.Push(result);
|
||||
|
||||
LOG_DEBUG(Service_CAM, "called");
|
||||
|
@ -1040,7 +1040,7 @@ void Module::Interface::SetPackageParameterWithContextDetail(Kernel::HLERequestC
|
|||
void Module::Interface::GetSuitableY2rStandardCoefficient(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp(ctx);
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push<u32>(0);
|
||||
|
||||
LOG_WARNING(Service_CAM, "(STUBBED) called");
|
||||
|
@ -1051,7 +1051,7 @@ void Module::Interface::PlayShutterSound(Kernel::HLERequestContext& ctx) {
|
|||
u8 sound_id = rp.Pop<u8>();
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
LOG_WARNING(Service_CAM, "(STUBBED) called, sound_id={}", sound_id);
|
||||
}
|
||||
|
@ -1081,7 +1081,7 @@ void Module::Interface::DriverInitialize(Kernel::HLERequestContext& ctx) {
|
|||
|
||||
cam->initialized = true;
|
||||
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
LOG_DEBUG(Service_CAM, "called");
|
||||
}
|
||||
|
@ -1099,7 +1099,7 @@ void Module::Interface::DriverFinalize(Kernel::HLERequestContext& ctx) {
|
|||
|
||||
cam->initialized = false;
|
||||
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
LOG_DEBUG(Service_CAM, "called");
|
||||
}
|
||||
|
|
|
@ -166,7 +166,7 @@ public:
|
|||
* 1: u8 selected port
|
||||
* Outputs:
|
||||
* 0: 0x00010040
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
*/
|
||||
void StartCapture(Kernel::HLERequestContext& ctx);
|
||||
|
||||
|
@ -177,7 +177,7 @@ public:
|
|||
* 1: u8 selected port
|
||||
* Outputs:
|
||||
* 0: 0x00020040
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
*/
|
||||
void StopCapture(Kernel::HLERequestContext& ctx);
|
||||
|
||||
|
@ -188,7 +188,7 @@ public:
|
|||
* 1: u8 selected port
|
||||
* Outputs:
|
||||
* 0: 0x00030080
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
* 2: 0 if not capturing, 1 if capturing
|
||||
*/
|
||||
void IsBusy(Kernel::HLERequestContext& ctx);
|
||||
|
@ -200,7 +200,7 @@ public:
|
|||
* 1: u8 selected port
|
||||
* Outputs:
|
||||
* 0: 0x00040040
|
||||
* 2: ResultCode
|
||||
* 2: Result
|
||||
*/
|
||||
void ClearBuffer(Kernel::HLERequestContext& ctx);
|
||||
|
||||
|
@ -211,7 +211,7 @@ public:
|
|||
* 1: u8 selected port
|
||||
* Outputs:
|
||||
* 0: 0x00050042
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
* 2: Descriptor: Handle
|
||||
* 3: Event handle
|
||||
*/
|
||||
|
@ -224,7 +224,7 @@ public:
|
|||
* 1: u8 selected port
|
||||
* Outputs:
|
||||
* 0: 0x00060042
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
* 2: Descriptor: Handle
|
||||
* 3: Event handle
|
||||
*/
|
||||
|
@ -244,7 +244,7 @@ public:
|
|||
* 6: Handle to destination process
|
||||
* Outputs:
|
||||
* 0: 0x00070042
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
* 2: Descriptor: Handle
|
||||
* 3: Handle to event signalled when transfer finishes
|
||||
*/
|
||||
|
@ -257,7 +257,7 @@ public:
|
|||
* 1: u8 selected port
|
||||
* Outputs:
|
||||
* 0: 0x00080080
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
* 2: 0 if not finished, 1 if finished
|
||||
*/
|
||||
void IsFinishedReceiving(Kernel::HLERequestContext& ctx);
|
||||
|
@ -272,7 +272,7 @@ public:
|
|||
* 4: u16 Height
|
||||
* Outputs:
|
||||
* 0: 0x00090040
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
* @todo figure out how the "buffer" actually works.
|
||||
*/
|
||||
void SetTransferLines(Kernel::HLERequestContext& ctx);
|
||||
|
@ -285,7 +285,7 @@ public:
|
|||
* 2: u16 Height
|
||||
* Outputs:
|
||||
* 0: 0x000A0080
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
* 2: Maximum number of lines that fit in the buffer
|
||||
* @todo figure out how the "buffer" actually works.
|
||||
*/
|
||||
|
@ -301,7 +301,7 @@ public:
|
|||
* 4: u16 Height
|
||||
* Outputs:
|
||||
* 0: 0x000B0040
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
* @todo figure out how the "buffer" actually works.
|
||||
*/
|
||||
void SetTransferBytes(Kernel::HLERequestContext& ctx);
|
||||
|
@ -313,7 +313,7 @@ public:
|
|||
* 1: u8 selected port
|
||||
* Outputs:
|
||||
* 0: 0x000C0080
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
* 2: The number of bytes the buffer contains
|
||||
* @todo figure out how the "buffer" actually works.
|
||||
*/
|
||||
|
@ -327,7 +327,7 @@ public:
|
|||
* 2: u16 Height
|
||||
* Outputs:
|
||||
* 0: 0x000D0080
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
* 2: Maximum number of bytes that fit in the buffer
|
||||
* @todo figure out how the "buffer" actually works.
|
||||
*/
|
||||
|
@ -341,7 +341,7 @@ public:
|
|||
* 2: u8 bool Enable trimming if true
|
||||
* Outputs:
|
||||
* 0: 0x000E0040
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
*/
|
||||
void SetTrimming(Kernel::HLERequestContext& ctx);
|
||||
|
||||
|
@ -352,7 +352,7 @@ public:
|
|||
* 1: u8 selected port
|
||||
* Outputs:
|
||||
* 0: 0x000F0080
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
* 2: u8 bool Enable trimming if true
|
||||
*/
|
||||
void IsTrimming(Kernel::HLERequestContext& ctx);
|
||||
|
@ -368,7 +368,7 @@ public:
|
|||
* 5: y end (exclusive)
|
||||
* Outputs:
|
||||
* 0: 0x00100040
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
*/
|
||||
void SetTrimmingParams(Kernel::HLERequestContext& ctx);
|
||||
|
||||
|
@ -380,7 +380,7 @@ public:
|
|||
*
|
||||
* Outputs:
|
||||
* 0: 0x00110140
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
* 2: x start
|
||||
* 3: y start
|
||||
* 4: x end (exclusive)
|
||||
|
@ -400,7 +400,7 @@ public:
|
|||
* 5: s16 Camera height
|
||||
* Outputs:
|
||||
* 0: 0x00120040
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
*/
|
||||
void SetTrimmingParamsCenter(Kernel::HLERequestContext& ctx);
|
||||
|
||||
|
@ -411,7 +411,7 @@ public:
|
|||
* 1: u8 selected camera
|
||||
* Outputs:
|
||||
* 0: 0x00130040
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
*/
|
||||
void Activate(Kernel::HLERequestContext& ctx);
|
||||
|
||||
|
@ -423,7 +423,7 @@ public:
|
|||
* 2: u8 selected context
|
||||
* Outputs:
|
||||
* 0: 0x00140040
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
*/
|
||||
void SwitchContext(Kernel::HLERequestContext& ctx);
|
||||
|
||||
|
@ -436,7 +436,7 @@ public:
|
|||
* 3: u8 selected context
|
||||
* Outputs:
|
||||
* 0: 0x001D0040
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
*/
|
||||
void FlipImage(Kernel::HLERequestContext& ctx);
|
||||
|
||||
|
@ -455,7 +455,7 @@ public:
|
|||
* 8: u8 selected context
|
||||
* Outputs:
|
||||
* 0: 0x001E0040
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
*/
|
||||
void SetDetailSize(Kernel::HLERequestContext& ctx);
|
||||
|
||||
|
@ -468,7 +468,7 @@ public:
|
|||
* 3: u8 selected context
|
||||
* Outputs:
|
||||
* 0: 0x001F0040
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
*/
|
||||
void SetSize(Kernel::HLERequestContext& ctx);
|
||||
|
||||
|
@ -480,7 +480,7 @@ public:
|
|||
* 2: u8 Camera framerate (`FrameRate` enum)
|
||||
* Outputs:
|
||||
* 0: 0x00200040
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
*/
|
||||
void SetFrameRate(Kernel::HLERequestContext& ctx);
|
||||
|
||||
|
@ -493,7 +493,7 @@ public:
|
|||
* 3: u8 selected context
|
||||
* Outputs:
|
||||
* 0: 0x00220040
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
*/
|
||||
void SetEffect(Kernel::HLERequestContext& ctx);
|
||||
|
||||
|
@ -506,7 +506,7 @@ public:
|
|||
* 3: u8 selected context
|
||||
* Outputs:
|
||||
* 0: 0x00250040
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
*/
|
||||
void SetOutputFormat(Kernel::HLERequestContext& ctx);
|
||||
|
||||
|
@ -518,7 +518,7 @@ public:
|
|||
* 2: u8 selected camera 2
|
||||
* Outputs:
|
||||
* 0: 0x00280040
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
*/
|
||||
void SynchronizeVsyncTiming(Kernel::HLERequestContext& ctx);
|
||||
|
||||
|
@ -532,7 +532,7 @@ public:
|
|||
* 65: s64* TimingsOutput
|
||||
* Outputs:
|
||||
* 0: 0x002A0042
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
* 2-3: Output static buffer
|
||||
*/
|
||||
void GetLatestVsyncTiming(Kernel::HLERequestContext& ctx);
|
||||
|
@ -545,7 +545,7 @@ public:
|
|||
* 0: 0x002B0000
|
||||
* Outputs:
|
||||
* 0: 0x002B0440
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
* 2-17: `StereoCameraCalibrationData` structure with calibration values
|
||||
*/
|
||||
void GetStereoCameraCalibrationData(Kernel::HLERequestContext& ctx);
|
||||
|
@ -559,7 +559,7 @@ public:
|
|||
* 8-11: unused
|
||||
* Outputs:
|
||||
* 0: 0x00330040
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
*/
|
||||
void SetPackageParameterWithoutContext(Kernel::HLERequestContext& ctx);
|
||||
|
||||
|
@ -572,7 +572,7 @@ public:
|
|||
* 3-5: unused
|
||||
* Outputs:
|
||||
* 0: 0x00340040
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
*/
|
||||
void SetPackageParameterWithContext(Kernel::HLERequestContext& ctx);
|
||||
|
||||
|
@ -585,7 +585,7 @@ public:
|
|||
* 5-7: unused
|
||||
* Outputs:
|
||||
* 0: 0x00350040
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
*/
|
||||
void SetPackageParameterWithContextDetail(Kernel::HLERequestContext& ctx);
|
||||
|
||||
|
@ -595,7 +595,7 @@ public:
|
|||
* 0: 0x00360000
|
||||
* Outputs:
|
||||
* 0: 0x00360080
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
* 2: ?
|
||||
*/
|
||||
void GetSuitableY2rStandardCoefficient(Kernel::HLERequestContext& ctx);
|
||||
|
@ -607,7 +607,7 @@ public:
|
|||
* 1: u8 Sound ID
|
||||
* Outputs:
|
||||
* 0: 0x00380040
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
*/
|
||||
void PlayShutterSound(Kernel::HLERequestContext& ctx);
|
||||
|
||||
|
@ -617,7 +617,7 @@ public:
|
|||
* 0: 0x00390000
|
||||
* Outputs:
|
||||
* 0: 0x00390040
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
*/
|
||||
void DriverInitialize(Kernel::HLERequestContext& ctx);
|
||||
|
||||
|
@ -627,7 +627,7 @@ public:
|
|||
* 0: 0x003A0000
|
||||
* Outputs:
|
||||
* 0: 0x003A0040
|
||||
* 1: ResultCode
|
||||
* 1: Result
|
||||
*/
|
||||
void DriverFinalize(Kernel::HLERequestContext& ctx);
|
||||
|
||||
|
@ -653,7 +653,7 @@ private:
|
|||
void ActivatePort(int port_id, int camera_id);
|
||||
|
||||
template <typename PackageParameterType>
|
||||
ResultCode SetPackageParameter(const PackageParameterType& package);
|
||||
Result SetPackageParameter(const PackageParameterType& package);
|
||||
|
||||
struct ContextConfig {
|
||||
Flip flip{Flip::None};
|
||||
|
|
|
@ -37,23 +37,23 @@ constexpr std::array<CoefficientSet, 4> standard_coefficients{{
|
|||
{{0x12A, 0x1CA, 0x88, 0x36, 0x21C, -0x1F04, 0x99C, -0x2421}}, // ITU_Rec709_Scaling
|
||||
}};
|
||||
|
||||
ResultCode ConversionConfiguration::SetInputLineWidth(u16 width) {
|
||||
Result ConversionConfiguration::SetInputLineWidth(u16 width) {
|
||||
if (width == 0 || width > 1024 || width % 8 != 0) {
|
||||
return ResultCode(ErrorDescription::OutOfRange, ErrorModule::CAM,
|
||||
ErrorSummary::InvalidArgument, ErrorLevel::Usage); // 0xE0E053FD
|
||||
return Result(ErrorDescription::OutOfRange, ErrorModule::CAM, ErrorSummary::InvalidArgument,
|
||||
ErrorLevel::Usage); // 0xE0E053FD
|
||||
}
|
||||
|
||||
// Note: The hardware uses the register value 0 to represent a width of 1024, so for a width of
|
||||
// 1024 the `camera` module would set the value 0 here, but we don't need to emulate this
|
||||
// internal detail.
|
||||
this->input_line_width = width;
|
||||
return RESULT_SUCCESS;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
ResultCode ConversionConfiguration::SetInputLines(u16 lines) {
|
||||
Result ConversionConfiguration::SetInputLines(u16 lines) {
|
||||
if (lines == 0 || lines > 1024) {
|
||||
return ResultCode(ErrorDescription::OutOfRange, ErrorModule::CAM,
|
||||
ErrorSummary::InvalidArgument, ErrorLevel::Usage); // 0xE0E053FD
|
||||
return Result(ErrorDescription::OutOfRange, ErrorModule::CAM, ErrorSummary::InvalidArgument,
|
||||
ErrorLevel::Usage); // 0xE0E053FD
|
||||
}
|
||||
|
||||
// Note: In what appears to be a bug, the `camera` module does not set the hardware register at
|
||||
|
@ -62,19 +62,18 @@ ResultCode ConversionConfiguration::SetInputLines(u16 lines) {
|
|||
if (lines != 1024) {
|
||||
this->input_lines = lines;
|
||||
}
|
||||
return RESULT_SUCCESS;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
ResultCode ConversionConfiguration::SetStandardCoefficient(
|
||||
StandardCoefficient standard_coefficient) {
|
||||
Result ConversionConfiguration::SetStandardCoefficient(StandardCoefficient standard_coefficient) {
|
||||
const auto index = static_cast<std::size_t>(standard_coefficient);
|
||||
if (index >= standard_coefficients.size()) {
|
||||
return ResultCode(ErrorDescription::InvalidEnumValue, ErrorModule::CAM,
|
||||
ErrorSummary::InvalidArgument, ErrorLevel::Usage); // 0xE0E053ED
|
||||
return Result(ErrorDescription::InvalidEnumValue, ErrorModule::CAM,
|
||||
ErrorSummary::InvalidArgument, ErrorLevel::Usage); // 0xE0E053ED
|
||||
}
|
||||
|
||||
std::memcpy(coefficients.data(), standard_coefficients[index].data(), sizeof(coefficients));
|
||||
return RESULT_SUCCESS;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
void Y2R_U::SetInputFormat(Kernel::HLERequestContext& ctx) {
|
||||
|
@ -83,7 +82,7 @@ void Y2R_U::SetInputFormat(Kernel::HLERequestContext& ctx) {
|
|||
conversion.input_format = rp.PopEnum<InputFormat>();
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "called input_format={}", conversion.input_format);
|
||||
}
|
||||
|
@ -92,7 +91,7 @@ void Y2R_U::GetInputFormat(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushEnum(conversion.input_format);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "called input_format={}", conversion.input_format);
|
||||
|
@ -104,7 +103,7 @@ void Y2R_U::SetOutputFormat(Kernel::HLERequestContext& ctx) {
|
|||
conversion.output_format = rp.PopEnum<OutputFormat>();
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "called output_format={}", conversion.output_format);
|
||||
}
|
||||
|
@ -113,7 +112,7 @@ void Y2R_U::GetOutputFormat(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushEnum(conversion.output_format);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "called output_format={}", conversion.output_format);
|
||||
|
@ -125,7 +124,7 @@ void Y2R_U::SetRotation(Kernel::HLERequestContext& ctx) {
|
|||
conversion.rotation = rp.PopEnum<Rotation>();
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "called rotation={}", conversion.rotation);
|
||||
}
|
||||
|
@ -134,7 +133,7 @@ void Y2R_U::GetRotation(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushEnum(conversion.rotation);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "called rotation={}", conversion.rotation);
|
||||
|
@ -146,7 +145,7 @@ void Y2R_U::SetBlockAlignment(Kernel::HLERequestContext& ctx) {
|
|||
conversion.block_alignment = rp.PopEnum<BlockAlignment>();
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "called block_alignment={}", conversion.block_alignment);
|
||||
}
|
||||
|
@ -155,7 +154,7 @@ void Y2R_U::GetBlockAlignment(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushEnum(conversion.block_alignment);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "called block_alignment={}", conversion.block_alignment);
|
||||
|
@ -167,7 +166,7 @@ void Y2R_U::SetSpacialDithering(Kernel::HLERequestContext& ctx) {
|
|||
spacial_dithering_enabled = rp.Pop<bool>();
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "(STUBBED) called");
|
||||
}
|
||||
|
@ -176,7 +175,7 @@ void Y2R_U::GetSpacialDithering(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(spacial_dithering_enabled);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "(STUBBED) called");
|
||||
|
@ -187,7 +186,7 @@ void Y2R_U::SetTemporalDithering(Kernel::HLERequestContext& ctx) {
|
|||
temporal_dithering_enabled = rp.Pop<bool>();
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "(STUBBED) called");
|
||||
}
|
||||
|
@ -196,7 +195,7 @@ void Y2R_U::GetTemporalDithering(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(temporal_dithering_enabled);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "(STUBBED) called");
|
||||
|
@ -207,7 +206,7 @@ void Y2R_U::SetTransferEndInterrupt(Kernel::HLERequestContext& ctx) {
|
|||
transfer_end_interrupt_enabled = rp.Pop<bool>();
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "(STUBBED) called");
|
||||
}
|
||||
|
@ -216,7 +215,7 @@ void Y2R_U::GetTransferEndInterrupt(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(transfer_end_interrupt_enabled);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "(STUBBED) called");
|
||||
|
@ -226,7 +225,7 @@ void Y2R_U::GetTransferEndEvent(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 2);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushCopyObjects(completion_event);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "called");
|
||||
|
@ -242,7 +241,7 @@ void Y2R_U::SetSendingY(Kernel::HLERequestContext& ctx) {
|
|||
// TODO (wwylele): pass process handle to y2r engine or convert VAddr to PAddr
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
LOG_DEBUG(Service_Y2R,
|
||||
"called image_size=0x{:08X}, transfer_unit={}, transfer_stride={}, "
|
||||
|
@ -261,7 +260,7 @@ void Y2R_U::SetSendingU(Kernel::HLERequestContext& ctx) {
|
|||
// TODO (wwylele): pass the process handle to y2r engine or convert VAddr to PAddr
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
LOG_DEBUG(Service_Y2R,
|
||||
"called image_size=0x{:08X}, transfer_unit={}, transfer_stride={}, "
|
||||
|
@ -281,7 +280,7 @@ void Y2R_U::SetSendingV(Kernel::HLERequestContext& ctx) {
|
|||
// TODO (wwylele): pass the process handle to y2r engine or convert VAddr to PAddr
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
LOG_DEBUG(Service_Y2R,
|
||||
"called image_size=0x{:08X}, transfer_unit={}, transfer_stride={}, "
|
||||
|
@ -301,7 +300,7 @@ void Y2R_U::SetSendingYUYV(Kernel::HLERequestContext& ctx) {
|
|||
// TODO (wwylele): pass the process handle to y2r engine or convert VAddr to PAddr
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
LOG_DEBUG(Service_Y2R,
|
||||
"called image_size=0x{:08X}, transfer_unit={}, transfer_stride={}, "
|
||||
|
@ -314,7 +313,7 @@ void Y2R_U::IsFinishedSendingYuv(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push<u8>(1);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "(STUBBED) called");
|
||||
|
@ -324,7 +323,7 @@ void Y2R_U::IsFinishedSendingY(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push<u8>(1);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "(STUBBED) called");
|
||||
|
@ -334,7 +333,7 @@ void Y2R_U::IsFinishedSendingU(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push<u8>(1);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "(STUBBED) called");
|
||||
|
@ -344,7 +343,7 @@ void Y2R_U::IsFinishedSendingV(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push<u8>(1);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "(STUBBED) called");
|
||||
|
@ -361,7 +360,7 @@ void Y2R_U::SetReceiving(Kernel::HLERequestContext& ctx) {
|
|||
// TODO (wwylele): pass the process handle to y2r engine or convert VAddr to PAddr
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
LOG_DEBUG(Service_Y2R,
|
||||
"called image_size=0x{:08X}, transfer_unit={}, transfer_stride={}, "
|
||||
|
@ -374,7 +373,7 @@ void Y2R_U::IsFinishedReceiving(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push<u8>(1);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "(STUBBED) called");
|
||||
|
@ -394,7 +393,7 @@ void Y2R_U::GetInputLineWidth(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(conversion.input_line_width);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "called input_line_width={}", conversion.input_line_width);
|
||||
|
@ -414,7 +413,7 @@ void Y2R_U::GetInputLines(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(static_cast<u32>(conversion.input_lines));
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "called input_lines={}", conversion.input_lines);
|
||||
|
@ -426,7 +425,7 @@ void Y2R_U::SetCoefficient(Kernel::HLERequestContext& ctx) {
|
|||
rp.PopRaw<CoefficientSet>(conversion.coefficients);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "called coefficients=[{:X}, {:X}, {:X}, {:X}, {:X}, {:X}, {:X}, {:X}]",
|
||||
conversion.coefficients[0], conversion.coefficients[1], conversion.coefficients[2],
|
||||
|
@ -438,7 +437,7 @@ void Y2R_U::GetCoefficient(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(5, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushRaw(conversion.coefficients);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "called");
|
||||
|
@ -460,14 +459,14 @@ void Y2R_U::GetStandardCoefficient(Kernel::HLERequestContext& ctx) {
|
|||
|
||||
if (index < standard_coefficients.size()) {
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(5, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushRaw(standard_coefficients[index]);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "called standard_coefficient={} ", index);
|
||||
} else {
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(ResultCode(ErrorDescription::InvalidEnumValue, ErrorModule::CAM,
|
||||
ErrorSummary::InvalidArgument, ErrorLevel::Usage));
|
||||
rb.Push(Result(ErrorDescription::InvalidEnumValue, ErrorModule::CAM,
|
||||
ErrorSummary::InvalidArgument, ErrorLevel::Usage));
|
||||
|
||||
LOG_ERROR(Service_Y2R, "called standard_coefficient={} The argument is invalid!", index);
|
||||
}
|
||||
|
@ -478,7 +477,7 @@ void Y2R_U::SetAlpha(Kernel::HLERequestContext& ctx) {
|
|||
conversion.alpha = rp.Pop<u32>();
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "called alpha={}", conversion.alpha);
|
||||
}
|
||||
|
@ -487,7 +486,7 @@ void Y2R_U::GetAlpha(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(conversion.alpha);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "called alpha={}", conversion.alpha);
|
||||
|
@ -497,7 +496,7 @@ void Y2R_U::SetDitheringWeightParams(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestParser rp(ctx);
|
||||
rp.PopRaw(dithering_weight_params);
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "called");
|
||||
}
|
||||
|
@ -506,7 +505,7 @@ void Y2R_U::GetDitheringWeightParams(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(9, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushRaw(dithering_weight_params);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "called");
|
||||
|
@ -526,7 +525,7 @@ void Y2R_U::StartConversion(Kernel::HLERequestContext& ctx) {
|
|||
completion_event->Signal();
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "called");
|
||||
}
|
||||
|
@ -535,7 +534,7 @@ void Y2R_U::StopConversion(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "called");
|
||||
}
|
||||
|
@ -544,7 +543,7 @@ void Y2R_U::IsBusyConversion(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push<u8>(0); // StartConversion always finishes immediately
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "called");
|
||||
|
@ -559,7 +558,7 @@ void Y2R_U::SetPackageParameter(Kernel::HLERequestContext& ctx) {
|
|||
conversion.rotation = params.rotation;
|
||||
conversion.block_alignment = params.block_alignment;
|
||||
|
||||
ResultCode result = conversion.SetInputLineWidth(params.input_line_width);
|
||||
Result result = conversion.SetInputLineWidth(params.input_line_width);
|
||||
|
||||
if (result.IsError())
|
||||
goto cleanup;
|
||||
|
@ -593,7 +592,7 @@ void Y2R_U::PingProcess(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push<u8>(0);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "(STUBBED) called");
|
||||
|
@ -621,7 +620,7 @@ void Y2R_U::DriverInitialize(Kernel::HLERequestContext& ctx) {
|
|||
|
||||
completion_event->Clear();
|
||||
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "called");
|
||||
}
|
||||
|
@ -630,7 +629,7 @@ void Y2R_U::DriverFinalize(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "called");
|
||||
}
|
||||
|
@ -639,7 +638,7 @@ void Y2R_U::GetPackageParameter(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(4, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushRaw(conversion);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "called");
|
||||
|
|
|
@ -120,9 +120,9 @@ struct ConversionConfiguration {
|
|||
/// Output parameters for the conversion results
|
||||
ConversionBuffer dst;
|
||||
|
||||
ResultCode SetInputLineWidth(u16 width);
|
||||
ResultCode SetInputLines(u16 lines);
|
||||
ResultCode SetStandardCoefficient(StandardCoefficient standard_coefficient);
|
||||
Result SetInputLineWidth(u16 width);
|
||||
Result SetInputLines(u16 lines);
|
||||
Result SetStandardCoefficient(StandardCoefficient standard_coefficient);
|
||||
|
||||
private:
|
||||
template <class Archive>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue