implement function GetOutputFormat and GetInputFormat

Signed-off-by: JamePeng <jame_peng@sina.com>
This commit is contained in:
JamePeng 2016-02-11 03:26:22 +08:00
parent c6198deec8
commit 1fea593c7e

View File

@ -84,13 +84,22 @@ ResultCode ConversionConfiguration::SetStandardCoefficient(StandardCoefficient s
static void SetInputFormat(Service::Interface* self) { static void SetInputFormat(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer(); u32* cmd_buff = Kernel::GetCommandBuffer();
conversion.input_format = static_cast<InputFormat>(cmd_buff[1]); conversion.input_format = static_cast<InputFormat>(cmd_buff[1]);
LOG_DEBUG(Service_Y2R, "called input_format=%hhu", conversion.input_format); LOG_DEBUG(Service_Y2R, "called input_format=%hhu", conversion.input_format);
cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[1] = RESULT_SUCCESS.raw;
} }
static void GetInputFormat(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
InputFormat inf = conversion.input_format;
LOG_DEBUG(Service_Y2R, "Get input_format=%hhu", inf);
cmd_buff[1] = RESULT_SUCCESS.raw;
cmd_buff[2] = static_cast<u32>(inf);
}
static void SetOutputFormat(Service::Interface* self) { static void SetOutputFormat(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer(); u32* cmd_buff = Kernel::GetCommandBuffer();
@ -100,6 +109,16 @@ static void SetOutputFormat(Service::Interface* self) {
cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[1] = RESULT_SUCCESS.raw;
} }
static void GetOutputFormat(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
OutputFormat opf = conversion.output_format;
LOG_DEBUG(Service_Y2R, "Get output_format=%hhu", opf);
cmd_buff[1] = RESULT_SUCCESS.raw;
cmd_buff[2] = static_cast<u32>(opf);
}
static void SetRotation(Service::Interface* self) { static void SetRotation(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer(); u32* cmd_buff = Kernel::GetCommandBuffer();
@ -375,9 +394,9 @@ static void DriverFinalize(Service::Interface* self) {
const Interface::FunctionInfo FunctionTable[] = { const Interface::FunctionInfo FunctionTable[] = {
{0x00010040, SetInputFormat, "SetInputFormat"}, {0x00010040, SetInputFormat, "SetInputFormat"},
{0x00020000, nullptr, "GetInputFormat"}, {0x00020000, GetInputFormat, "GetInputFormat"},
{0x00030040, SetOutputFormat, "SetOutputFormat"}, {0x00030040, SetOutputFormat, "SetOutputFormat"},
{0x00040000, nullptr, "GetOutputFormat"}, {0x00040000, SetOutputFormat, "GetOutputFormat"},
{0x00050040, SetRotation, "SetRotation"}, {0x00050040, SetRotation, "SetRotation"},
{0x00060000, nullptr, "GetRotation"}, {0x00060000, nullptr, "GetRotation"},
{0x00070040, SetBlockAlignment, "SetBlockAlignment"}, {0x00070040, SetBlockAlignment, "SetBlockAlignment"},