diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/arm/skyeye_common/vfp/vfpsingle.cpp | 46 | ||||
-rw-r--r-- | src/core/hle/service/gsp_gpu.cpp | 9 | ||||
-rw-r--r-- | src/core/hle/service/y2r_u.cpp | 11 | ||||
-rw-r--r-- | src/core/hw/gpu.cpp | 16 | ||||
-rw-r--r-- | src/core/settings.h | 2 |
5 files changed, 58 insertions, 26 deletions
diff --git a/src/core/arm/skyeye_common/vfp/vfpsingle.cpp b/src/core/arm/skyeye_common/vfp/vfpsingle.cpp index 9a7ca5c14..5a655a6f2 100644 --- a/src/core/arm/skyeye_common/vfp/vfpsingle.cpp +++ b/src/core/arm/skyeye_common/vfp/vfpsingle.cpp @@ -67,7 +67,7 @@ static struct vfp_single vfp_single_default_qnan = { static void vfp_single_dump(const char *str, struct vfp_single *s) { - LOG_DEBUG(Core_ARM11, "%s: sign=%d exponent=%d significand=%08x", + LOG_TRACE(Core_ARM11, "%s: sign=%d exponent=%d significand=%08x", str, s->sign != 0, s->exponent, s->significand); } @@ -158,7 +158,7 @@ u32 vfp_single_normaliseround(ARMul_State* state, int sd, struct vfp_single *vs, } else if ((rmode == FPSCR_ROUND_PLUSINF) ^ (vs->sign != 0)) incr = (1 << (VFP_SINGLE_LOW_BITS + 1)) - 1; - LOG_DEBUG(Core_ARM11, "rounding increment = 0x%08x", incr); + LOG_TRACE(Core_ARM11, "rounding increment = 0x%08x", incr); /* * Is our rounding going to overflow? @@ -213,7 +213,7 @@ pack: vfp_single_dump("pack: final", vs); { s32 d = vfp_single_pack(vs); - LOG_DEBUG(Core_ARM11, "%s: d(s%d)=%08x exceptions=%08x", func, + LOG_TRACE(Core_ARM11, "%s: d(s%d)=%08x exceptions=%08x", func, sd, d, exceptions); vfp_put_float(state, d, sd); } @@ -304,7 +304,7 @@ u32 vfp_estimate_sqrt_significand(u32 exponent, u32 significand) u32 z, a; if ((significand & 0xc0000000) != 0x40000000) { - LOG_DEBUG(Core_ARM11, "invalid significand"); + LOG_TRACE(Core_ARM11, "invalid significand"); } a = significand << 1; @@ -394,7 +394,7 @@ sqrt_invalid: term = (u64)vsd.significand * vsd.significand; rem = ((u64)vsm.significand << 32) - term; - LOG_DEBUG(Core_ARM11, "term=%016" PRIx64 "rem=%016" PRIx64, term, rem); + LOG_TRACE(Core_ARM11, "term=%016" PRIx64 "rem=%016" PRIx64, term, rem); while (rem < 0) { vsd.significand -= 1; @@ -626,7 +626,7 @@ static u32 vfp_single_ftoui(ARMul_State* state, int sd, int unused, s32 m, u32 f } } - LOG_DEBUG(Core_ARM11, "ftoui: d(s%d)=%08x exceptions=%08x", sd, d, exceptions); + LOG_TRACE(Core_ARM11, "ftoui: d(s%d)=%08x exceptions=%08x", sd, d, exceptions); vfp_put_float(state, d, sd); @@ -705,7 +705,7 @@ static u32 vfp_single_ftosi(ARMul_State* state, int sd, int unused, s32 m, u32 f } } - LOG_DEBUG(Core_ARM11, "ftosi: d(s%d)=%08x exceptions=%08x", sd, d, exceptions); + LOG_TRACE(Core_ARM11, "ftosi: d(s%d)=%08x exceptions=%08x", sd, d, exceptions); vfp_put_float(state, (s32)d, sd); @@ -873,7 +873,7 @@ vfp_single_multiply(struct vfp_single *vsd, struct vfp_single *vsn, struct vfp_s struct vfp_single *t = vsn; vsn = vsm; vsm = t; - LOG_DEBUG(Core_ARM11, "swapping M <-> N"); + LOG_TRACE(Core_ARM11, "swapping M <-> N"); } vsd->sign = vsn->sign ^ vsm->sign; @@ -926,7 +926,7 @@ vfp_single_multiply_accumulate(ARMul_State* state, int sd, int sn, s32 m, u32 fp s32 v; v = vfp_get_float(state, sn); - LOG_DEBUG(Core_ARM11, "s%u = %08x", sn, v); + LOG_TRACE(Core_ARM11, "s%u = %08x", sn, v); vfp_single_unpack(&vsn, v, &fpscr); if (vsn.exponent == 0 && vsn.significand) vfp_single_normalise_denormal(&vsn); @@ -941,7 +941,7 @@ vfp_single_multiply_accumulate(ARMul_State* state, int sd, int sn, s32 m, u32 fp vsp.sign = vfp_sign_negate(vsp.sign); v = vfp_get_float(state, sd); - LOG_DEBUG(Core_ARM11, "s%u = %08x", sd, v); + LOG_TRACE(Core_ARM11, "s%u = %08x", sd, v); vfp_single_unpack(&vsn, v, &fpscr); if (vsn.exponent == 0 && vsn.significand != 0) vfp_single_normalise_denormal(&vsn); @@ -963,7 +963,7 @@ vfp_single_multiply_accumulate(ARMul_State* state, int sd, int sn, s32 m, u32 fp */ static u32 vfp_single_fmac(ARMul_State* state, int sd, int sn, s32 m, u32 fpscr) { - LOG_DEBUG(Core_ARM11, "s%u = %08x", sn, sd); + LOG_TRACE(Core_ARM11, "s%u = %08x", sn, sd); return vfp_single_multiply_accumulate(state, sd, sn, m, fpscr, 0, "fmac"); } @@ -973,7 +973,7 @@ static u32 vfp_single_fmac(ARMul_State* state, int sd, int sn, s32 m, u32 fpscr) static u32 vfp_single_fnmac(ARMul_State* state, int sd, int sn, s32 m, u32 fpscr) { // TODO: this one has its arguments inverted, investigate. - LOG_DEBUG(Core_ARM11, "s%u = %08x", sd, sn); + LOG_TRACE(Core_ARM11, "s%u = %08x", sd, sn); return vfp_single_multiply_accumulate(state, sd, sn, m, fpscr, NEG_MULTIPLY, "fnmac"); } @@ -982,7 +982,7 @@ static u32 vfp_single_fnmac(ARMul_State* state, int sd, int sn, s32 m, u32 fpscr */ static u32 vfp_single_fmsc(ARMul_State* state, int sd, int sn, s32 m, u32 fpscr) { - LOG_DEBUG(Core_ARM11, "s%u = %08x", sn, sd); + LOG_TRACE(Core_ARM11, "s%u = %08x", sn, sd); return vfp_single_multiply_accumulate(state, sd, sn, m, fpscr, NEG_SUBTRACT, "fmsc"); } @@ -991,7 +991,7 @@ static u32 vfp_single_fmsc(ARMul_State* state, int sd, int sn, s32 m, u32 fpscr) */ static u32 vfp_single_fnmsc(ARMul_State* state, int sd, int sn, s32 m, u32 fpscr) { - LOG_DEBUG(Core_ARM11, "s%u = %08x", sn, sd); + LOG_TRACE(Core_ARM11, "s%u = %08x", sn, sd); return vfp_single_multiply_accumulate(state, sd, sn, m, fpscr, NEG_SUBTRACT | NEG_MULTIPLY, "fnmsc"); } @@ -1004,7 +1004,7 @@ static u32 vfp_single_fmul(ARMul_State* state, int sd, int sn, s32 m, u32 fpscr) u32 exceptions; s32 n = vfp_get_float(state, sn); - LOG_DEBUG(Core_ARM11, "s%u = %08x", sn, n); + LOG_TRACE(Core_ARM11, "s%u = %08x", sn, n); vfp_single_unpack(&vsn, n, &fpscr); if (vsn.exponent == 0 && vsn.significand) @@ -1027,7 +1027,7 @@ static u32 vfp_single_fnmul(ARMul_State* state, int sd, int sn, s32 m, u32 fpscr u32 exceptions; s32 n = vfp_get_float(state, sn); - LOG_DEBUG(Core_ARM11, "s%u = %08x", sn, n); + LOG_TRACE(Core_ARM11, "s%u = %08x", sn, n); vfp_single_unpack(&vsn, n, &fpscr); if (vsn.exponent == 0 && vsn.significand) @@ -1051,7 +1051,7 @@ static u32 vfp_single_fadd(ARMul_State* state, int sd, int sn, s32 m, u32 fpscr) u32 exceptions; s32 n = vfp_get_float(state, sn); - LOG_DEBUG(Core_ARM11, "s%u = %08x", sn, n); + LOG_TRACE(Core_ARM11, "s%u = %08x", sn, n); /* * Unpack and normalise denormals. @@ -1074,7 +1074,7 @@ static u32 vfp_single_fadd(ARMul_State* state, int sd, int sn, s32 m, u32 fpscr) */ static u32 vfp_single_fsub(ARMul_State* state, int sd, int sn, s32 m, u32 fpscr) { - LOG_DEBUG(Core_ARM11, "s%u = %08x", sn, sd); + LOG_TRACE(Core_ARM11, "s%u = %08x", sn, sd); /* * Subtraction is addition with one sign inverted. */ @@ -1094,7 +1094,7 @@ static u32 vfp_single_fdiv(ARMul_State* state, int sd, int sn, s32 m, u32 fpscr) s32 n = vfp_get_float(state, sn); int tm, tn; - LOG_DEBUG(Core_ARM11, "s%u = %08x", sn, n); + LOG_TRACE(Core_ARM11, "s%u = %08x", sn, n); vfp_single_unpack(&vsn, n, &fpscr); vfp_single_unpack(&vsm, m, &fpscr); @@ -1241,7 +1241,7 @@ u32 vfp_single_cpdo(ARMul_State* state, u32 inst, u32 fpscr) else veclen = fpscr & FPSCR_LENGTH_MASK; - LOG_DEBUG(Core_ARM11, "vecstride=%u veclen=%u", vecstride, + LOG_TRACE(Core_ARM11, "vecstride=%u veclen=%u", vecstride, (veclen >> FPSCR_LENGTH_BIT) + 1); if (!fop->fn) { @@ -1257,16 +1257,16 @@ u32 vfp_single_cpdo(ARMul_State* state, u32 inst, u32 fpscr) type = (fop->flags & OP_DD) ? 'd' : 's'; if (op == FOP_EXT) - LOG_DEBUG(Core_ARM11, "itr%d (%c%u) = op[%u] (s%u=%08x)", + LOG_TRACE(Core_ARM11, "itr%d (%c%u) = op[%u] (s%u=%08x)", vecitr >> FPSCR_LENGTH_BIT, type, dest, sn, sm, m); else - LOG_DEBUG(Core_ARM11, "itr%d (%c%u) = (s%u) op[%u] (s%u=%08x)", + LOG_TRACE(Core_ARM11, "itr%d (%c%u) = (s%u) op[%u] (s%u=%08x)", vecitr >> FPSCR_LENGTH_BIT, type, dest, sn, FOP_TO_IDX(op), sm, m); except = fop->fn(state, dest, sn, m, fpscr); - LOG_DEBUG(Core_ARM11, "itr%d: exceptions=%08x", + LOG_TRACE(Core_ARM11, "itr%d: exceptions=%08x", vecitr >> FPSCR_LENGTH_BIT, except); exceptions |= except; diff --git a/src/core/hle/service/gsp_gpu.cpp b/src/core/hle/service/gsp_gpu.cpp index c11c5faba..c56475ae4 100644 --- a/src/core/hle/service/gsp_gpu.cpp +++ b/src/core/hle/service/gsp_gpu.cpp @@ -15,6 +15,7 @@ #include "core/hw/lcd.h" #include "video_core/gpu_debugger.h" +#include "video_core/video_core.h" // Main graphics debugger object - TODO: Here is probably not the best place for this GraphicsDebugger g_debugger; @@ -264,6 +265,8 @@ static void FlushDataCache(Service::Interface* self) { u32 size = cmd_buff[2]; u32 process = cmd_buff[4]; + VideoCore::g_renderer->hw_rasterizer->NotifyFlush(Memory::VirtualToPhysicalAddress(address), size); + // TODO(purpasmart96): Verify return header on HW cmd_buff[1] = RESULT_SUCCESS.raw; // No error @@ -352,10 +355,16 @@ static void ExecuteCommand(const Command& command, u32 thread_id) { // GX request DMA - typically used for copying memory from GSP heap to VRAM case CommandId::REQUEST_DMA: + VideoCore::g_renderer->hw_rasterizer->NotifyPreRead(Memory::VirtualToPhysicalAddress(command.dma_request.source_address), + command.dma_request.size); + memcpy(Memory::GetPointer(command.dma_request.dest_address), Memory::GetPointer(command.dma_request.source_address), command.dma_request.size); SignalInterrupt(InterruptId::DMA); + + VideoCore::g_renderer->hw_rasterizer->NotifyFlush(Memory::VirtualToPhysicalAddress(command.dma_request.dest_address), + command.dma_request.size); break; // ctrulib homebrew sends all relevant command list data with this command, diff --git a/src/core/hle/service/y2r_u.cpp b/src/core/hle/service/y2r_u.cpp index ce822e990..15987e028 100644 --- a/src/core/hle/service/y2r_u.cpp +++ b/src/core/hle/service/y2r_u.cpp @@ -9,7 +9,11 @@ #include "core/hle/hle.h" #include "core/hle/kernel/event.h" #include "core/hle/service/y2r_u.h" +#include "core/mem_map.h" +#include "core/memory.h" + #include "video_core/utils.h" +#include "video_core/video_core.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // Namespace Y2R_U @@ -260,6 +264,13 @@ static void StartConversion(Service::Interface* self) { break; } } + + // dst_image_size would seem to be perfect for this, but it doesn't include the stride :( + u32 total_output_size = conversion_params.input_lines * + (conversion_params.dst_transfer_unit + conversion_params.dst_stride); + VideoCore::g_renderer->hw_rasterizer->NotifyFlush( + Memory::VirtualToPhysicalAddress(conversion_params.dst_address), total_output_size); + LOG_DEBUG(Service_Y2R, "called"); completion_event->Signal(); diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp index 8ef1f70df..ddc5d647e 100644 --- a/src/core/hw/gpu.cpp +++ b/src/core/hw/gpu.cpp @@ -106,6 +106,8 @@ inline void Write(u32 addr, const T data) { } else { GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PSC1); } + + VideoCore::g_renderer->hw_rasterizer->NotifyFlush(config.GetStartAddress(), config.GetEndAddress() - config.GetStartAddress()); } break; } @@ -129,19 +131,25 @@ inline void Write(u32 addr, const T data) { u32 output_width = config.output_width / horizontal_scale; u32 output_height = config.output_height / vertical_scale; + u32 input_size = config.input_width * config.input_height * GPU::Regs::BytesPerPixel(config.input_format); + u32 output_size = output_width * output_height * GPU::Regs::BytesPerPixel(config.output_format); + + VideoCore::g_renderer->hw_rasterizer->NotifyPreRead(config.GetPhysicalInputAddress(), input_size); + if (config.raw_copy) { // Raw copies do not perform color conversion nor tiled->linear / linear->tiled conversions // TODO(Subv): Verify if raw copies perform scaling - memcpy(dst_pointer, src_pointer, config.output_width * config.output_height * - GPU::Regs::BytesPerPixel(config.output_format)); + memcpy(dst_pointer, src_pointer, output_size); LOG_TRACE(HW_GPU, "DisplayTriggerTransfer: 0x%08x bytes from 0x%08x(%ux%u)-> 0x%08x(%ux%u), output format: %x, flags 0x%08X, Raw copy", - config.output_height * output_width * GPU::Regs::BytesPerPixel(config.output_format), + output_size, config.GetPhysicalInputAddress(), config.input_width.Value(), config.input_height.Value(), config.GetPhysicalOutputAddress(), config.output_width.Value(), config.output_height.Value(), config.output_format.Value(), config.flags); GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PPF); + + VideoCore::g_renderer->hw_rasterizer->NotifyFlush(config.GetPhysicalOutputAddress(), output_size); break; } @@ -247,6 +255,8 @@ inline void Write(u32 addr, const T data) { config.output_format.Value(), config.flags); GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PPF); + + VideoCore::g_renderer->hw_rasterizer->NotifyFlush(config.GetPhysicalOutputAddress(), output_size); } break; } diff --git a/src/core/settings.h b/src/core/settings.h index 0f4700241..54c1023b8 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -45,6 +45,8 @@ struct Values { int region_value; // Renderer + bool use_hw_renderer; + float bg_red; float bg_green; float bg_blue; |