mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-12-25 01:11:48 +01:00
Merge pull request #5395 from lioncash/gsp
gsp_gpu: Resolve sign conversion warnings
This commit is contained in:
commit
2fc7def6f6
@ -32,7 +32,7 @@ GraphicsDebugger g_debugger;
|
|||||||
namespace Service::GSP {
|
namespace Service::GSP {
|
||||||
|
|
||||||
// Beginning address of HW regs
|
// Beginning address of HW regs
|
||||||
const u32 REGS_BEGIN = 0x1EB00000;
|
constexpr u32 REGS_BEGIN = 0x1EB00000;
|
||||||
|
|
||||||
namespace ErrCodes {
|
namespace ErrCodes {
|
||||||
enum {
|
enum {
|
||||||
@ -78,7 +78,7 @@ static PAddr VirtualToPhysicalAddress(VAddr addr) {
|
|||||||
return addr | 0x80000000;
|
return addr | 0x80000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 GSP_GPU::GetUnusedThreadId() {
|
u32 GSP_GPU::GetUnusedThreadId() const {
|
||||||
for (u32 id = 0; id < MaxGSPThreads; ++id) {
|
for (u32 id = 0; id < MaxGSPThreads; ++id) {
|
||||||
if (!used_thread_ids[id])
|
if (!used_thread_ids[id])
|
||||||
return id;
|
return id;
|
||||||
@ -109,9 +109,10 @@ static inline InterruptRelayQueue* GetInterruptRelayQueue(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GSP_GPU::ClientDisconnected(std::shared_ptr<Kernel::ServerSession> server_session) {
|
void GSP_GPU::ClientDisconnected(std::shared_ptr<Kernel::ServerSession> server_session) {
|
||||||
SessionData* session_data = GetSessionData(server_session);
|
const SessionData* session_data = GetSessionData(server_session);
|
||||||
if (active_thread_id == session_data->thread_id)
|
if (active_thread_id == session_data->thread_id) {
|
||||||
ReleaseRight(session_data);
|
ReleaseRight(session_data);
|
||||||
|
}
|
||||||
SessionRequestHandler::ClientDisconnected(server_session);
|
SessionRequestHandler::ClientDisconnected(server_session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -470,8 +471,9 @@ void GSP_GPU::SignalInterrupt(InterruptId interrupt_id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// For normal interrupts, don't do anything if no process has acquired the GPU right.
|
// For normal interrupts, don't do anything if no process has acquired the GPU right.
|
||||||
if (active_thread_id == -1)
|
if (active_thread_id == UINT32_MAX) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
SignalInterruptForThread(interrupt_id, active_thread_id);
|
SignalInterruptForThread(interrupt_id, active_thread_id);
|
||||||
}
|
}
|
||||||
@ -712,23 +714,23 @@ void GSP_GPU::AcquireRight(Kernel::HLERequestContext& ctx) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO(Subv): This case should put the caller thread to sleep until the right is released.
|
// TODO(Subv): This case should put the caller thread to sleep until the right is released.
|
||||||
ASSERT_MSG(active_thread_id == -1, "GPU right has already been acquired");
|
ASSERT_MSG(active_thread_id == UINT32_MAX, "GPU right has already been acquired");
|
||||||
|
|
||||||
active_thread_id = session_data->thread_id;
|
active_thread_id = session_data->thread_id;
|
||||||
|
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GSP_GPU::ReleaseRight(SessionData* session_data) {
|
void GSP_GPU::ReleaseRight(const SessionData* session_data) {
|
||||||
ASSERT_MSG(active_thread_id == session_data->thread_id,
|
ASSERT_MSG(active_thread_id == session_data->thread_id,
|
||||||
"Wrong thread tried to release GPU right");
|
"Wrong thread tried to release GPU right");
|
||||||
active_thread_id = -1;
|
active_thread_id = UINT32_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GSP_GPU::ReleaseRight(Kernel::HLERequestContext& ctx) {
|
void GSP_GPU::ReleaseRight(Kernel::HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp(ctx, 0x17, 0, 0);
|
IPC::RequestParser rp(ctx, 0x17, 0, 0);
|
||||||
|
|
||||||
SessionData* session_data = GetSessionData(ctx.Session());
|
const SessionData* session_data = GetSessionData(ctx.Session());
|
||||||
ReleaseRight(session_data);
|
ReleaseRight(session_data);
|
||||||
|
|
||||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||||
|
@ -379,7 +379,7 @@ private:
|
|||||||
* Releases rights to the GPU.
|
* Releases rights to the GPU.
|
||||||
* Will fail if the session_data doesn't have the GPU right
|
* Will fail if the session_data doesn't have the GPU right
|
||||||
*/
|
*/
|
||||||
void ReleaseRight(SessionData* session_data);
|
void ReleaseRight(const SessionData* session_data);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GSP_GPU::ImportDisplayCaptureInfo service function
|
* GSP_GPU::ImportDisplayCaptureInfo service function
|
||||||
@ -424,7 +424,7 @@ private:
|
|||||||
/// Returns the session data for the specified registered thread id, or nullptr if not found.
|
/// Returns the session data for the specified registered thread id, or nullptr if not found.
|
||||||
SessionData* FindRegisteredThreadData(u32 thread_id);
|
SessionData* FindRegisteredThreadData(u32 thread_id);
|
||||||
|
|
||||||
u32 GetUnusedThreadId();
|
u32 GetUnusedThreadId() const;
|
||||||
|
|
||||||
std::unique_ptr<Kernel::SessionRequestHandler::SessionDataBase> MakeSessionData() override;
|
std::unique_ptr<Kernel::SessionRequestHandler::SessionDataBase> MakeSessionData() override;
|
||||||
|
|
||||||
@ -433,8 +433,8 @@ private:
|
|||||||
/// GSP shared memory
|
/// GSP shared memory
|
||||||
std::shared_ptr<Kernel::SharedMemory> shared_memory;
|
std::shared_ptr<Kernel::SharedMemory> shared_memory;
|
||||||
|
|
||||||
/// Thread id that currently has GPU rights or -1 if none.
|
/// Thread id that currently has GPU rights or UINT32_MAX if none.
|
||||||
int active_thread_id = -1;
|
u32 active_thread_id = UINT32_MAX;
|
||||||
|
|
||||||
bool first_initialization = true;
|
bool first_initialization = true;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user