2018-01-13 22:22:39 +01:00
|
|
|
// Copyright 2018 yuzu emulator team
|
2018-01-09 16:41:13 +01:00
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#include "common/assert.h"
|
|
|
|
#include "common/logging/log.h"
|
2018-01-17 04:44:02 +01:00
|
|
|
#include "core/core.h"
|
2018-01-09 16:41:13 +01:00
|
|
|
#include "core/hle/service/nvdrv/devices/nvdisp_disp0.h"
|
|
|
|
#include "core/hle/service/nvdrv/devices/nvmap.h"
|
2018-01-11 04:45:01 +01:00
|
|
|
#include "video_core/renderer_base.h"
|
|
|
|
#include "video_core/video_core.h"
|
2018-01-09 16:41:13 +01:00
|
|
|
|
2018-04-20 03:41:44 +02:00
|
|
|
namespace Service::Nvidia::Devices {
|
2018-01-09 16:41:13 +01:00
|
|
|
|
Extra nvdrv support (#162)
* FinishInitalize needed for 3.0.1+ games
* nvdrv:s and nvdrv:t both use NVDRV
* Most settings return 0 on hardware, disabled NV_MEMORY_PROFILER for now.
NVN_THROUGH_OPENGL & NVRM_GPU_PREVENT_USE are a few interesting settings to look at. Carefully choosing settings can help with drawing graphics later on
* Initial /dev/nvhost-gpu support
* ZCullBind
* Stubbed SetErrorNotifier
* Fixed SetErrorNotifier log, Added SetChannelPriority
* Allocate GPFIFO Ex2, Allocate Obj Ctx, Submit GPFIFO
* oops
* Fixed up naming/structs/enums. Used vector instead of array for "gpfifo_entry"
* Added missing fixes
* /dev/nvhost-ctrl-gpu
* unneeded struct
* Forgot u32 in enum class
* Automatic descriptor swapping for ioctls, fixed nvgpu_gpu_get_tpc_masks_args being incorrect size
* nvdrv#QueryEvent
* Renamed logs for nvdrv
* Refactor ioctl so nv_result isn't needed
* /dev/nvhost-as-gpu
* Fixed Log service naming, CtxObjects now u32, renamed all structs, added static_asserts to structs, used INSERT_PADDING_WORDS instead of u32s
* nvdevices now uses "Ioctl" union,
* IoctlGpfifoEntry now uses bit field
* final changes
2018-02-06 03:19:31 +01:00
|
|
|
u32 nvdisp_disp0::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
|
2018-04-23 18:13:53 +02:00
|
|
|
UNIMPLEMENTED_MSG("Unimplemented ioctl");
|
2018-01-09 16:41:13 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void nvdisp_disp0::flip(u32 buffer_handle, u32 offset, u32 format, u32 width, u32 height,
|
2018-02-12 01:03:31 +01:00
|
|
|
u32 stride, NVFlinger::BufferQueue::BufferTransformFlags transform) {
|
2018-01-09 16:41:13 +01:00
|
|
|
VAddr addr = nvmap_dev->GetObjectAddress(buffer_handle);
|
2018-04-24 16:33:33 +02:00
|
|
|
NGLOG_WARNING(Service,
|
|
|
|
"Drawing from address {:X} offset {:08X} Width {} Height {} Stride {} Format {}",
|
|
|
|
addr, offset, width, height, stride, format);
|
2018-01-11 04:45:01 +01:00
|
|
|
|
2018-03-23 02:04:30 +01:00
|
|
|
using PixelFormat = Tegra::FramebufferConfig::PixelFormat;
|
|
|
|
const Tegra::FramebufferConfig framebuffer{
|
2018-03-23 19:58:27 +01:00
|
|
|
addr, offset, width, height, stride, static_cast<PixelFormat>(format), transform};
|
2018-01-17 04:44:02 +01:00
|
|
|
|
|
|
|
Core::System::GetInstance().perf_stats.EndGameFrame();
|
2018-03-23 04:18:04 +01:00
|
|
|
|
2018-03-23 02:04:30 +01:00
|
|
|
VideoCore::g_renderer->SwapBuffers(framebuffer);
|
2018-01-09 16:41:13 +01:00
|
|
|
}
|
|
|
|
|
2018-04-20 03:41:44 +02:00
|
|
|
} // namespace Service::Nvidia::Devices
|