Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Suyu
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Suyu
Commits
8dee5663
There was an error fetching the commit references. Please try again later.
Commit
8dee5663
authored
7 years ago
by
Subv
Browse files
Options
Downloads
Patches
Plain Diff
Vi: Properly write the BufferProducerFence object in the DequeueBuffer response parcel.
parent
db873a23
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/core/hle/service/nvdrv/nvdrv.h
+7
-0
7 additions, 0 deletions
src/core/hle/service/nvdrv/nvdrv.h
src/core/hle/service/vi/vi.cpp
+21
-18
21 additions, 18 deletions
src/core/hle/service/vi/vi.cpp
with
28 additions
and
18 deletions
src/core/hle/service/nvdrv/nvdrv.h
+
7
−
0
View file @
8dee5663
...
@@ -17,6 +17,13 @@ namespace Devices {
...
@@ -17,6 +17,13 @@ namespace Devices {
class
nvdevice
;
class
nvdevice
;
}
}
struct
IoctlFence
{
u32
id
;
u32
value
;
};
static_assert
(
sizeof
(
IoctlFence
)
==
8
,
"IoctlFence has wrong size"
);
class
Module
final
{
class
Module
final
{
public:
public:
Module
();
Module
();
...
...
This diff is collapsed.
Click to expand it.
src/core/hle/service/vi/vi.cpp
+
21
−
18
View file @
8dee5663
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
#include
"common/scope_exit.h"
#include
"common/scope_exit.h"
#include
"core/core_timing.h"
#include
"core/core_timing.h"
#include
"core/hle/ipc_helpers.h"
#include
"core/hle/ipc_helpers.h"
#include
"core/hle/service/nvdrv/nvdrv.h"
#include
"core/hle/service/nvflinger/buffer_queue.h"
#include
"core/hle/service/nvflinger/buffer_queue.h"
#include
"core/hle/service/vi/vi.h"
#include
"core/hle/service/vi/vi.h"
#include
"core/hle/service/vi/vi_m.h"
#include
"core/hle/service/vi/vi_m.h"
...
@@ -86,6 +87,15 @@ public:
...
@@ -86,6 +87,15 @@ public:
write_index
=
Common
::
AlignUp
(
write_index
,
4
);
write_index
=
Common
::
AlignUp
(
write_index
,
4
);
}
}
template
<
typename
T
>
void
WriteObject
(
const
T
&
val
)
{
u32_le
size
=
static_cast
<
u32
>
(
sizeof
(
val
));
Write
(
size
);
// TODO(Subv): Support file descriptors.
Write
<
u32_le
>
(
0
);
// Fd count.
Write
(
val
);
}
void
Deserialize
()
{
void
Deserialize
()
{
Header
header
{};
Header
header
{};
std
::
memcpy
(
&
header
,
buffer
.
data
(),
sizeof
(
Header
));
std
::
memcpy
(
&
header
,
buffer
.
data
(),
sizeof
(
Header
));
...
@@ -262,10 +272,11 @@ public:
...
@@ -262,10 +272,11 @@ public:
Data
data
;
Data
data
;
};
};
// TODO(bunnei): Remove this. When set to 1, games will think a fence is valid and boot further.
struct
BufferProducerFence
{
// This will break libnx and potentially other apps that more stringently check this. This is here
u32
is_valid
;
// purely as a convenience, and should go away once we implement fences.
std
::
array
<
Nvidia
::
IoctlFence
,
4
>
fences
;
static
constexpr
u32
FENCE_HACK
=
0
;
};
static_assert
(
sizeof
(
BufferProducerFence
)
==
36
,
"BufferProducerFence has wrong size"
);
class
IGBPDequeueBufferResponseParcel
:
public
Parcel
{
class
IGBPDequeueBufferResponseParcel
:
public
Parcel
{
public:
public:
...
@@ -274,20 +285,12 @@ public:
...
@@ -274,20 +285,12 @@ public:
protected
:
protected
:
void
SerializeData
()
override
{
void
SerializeData
()
override
{
// TODO(bunnei): Find out what this all means. Writing anything non-zero here breaks libnx.
// TODO(Subv): Find out how this Fence is used.
Write
<
u32
>
(
0
);
BufferProducerFence
fence
=
{};
Write
<
u32
>
(
FENCE_HACK
);
Write
<
u32
>
(
0
);
Write
(
slot
);
Write
<
u32
>
(
0
);
WriteObject
(
fence
);
Write
<
u32
>
(
0
);
Write
<
u32_le
>
(
0
);
Write
<
u32
>
(
0
);
Write
<
u32
>
(
0
);
Write
<
u32
>
(
0
);
Write
<
u32
>
(
0
);
Write
<
u32
>
(
0
);
Write
<
u32
>
(
0
);
Write
<
u32
>
(
0
);
Write
<
u32
>
(
0
);
}
}
u32_le
slot
;
u32_le
slot
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment