mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-15 22:54:00 +00:00
NvDrv/nvhost-as-gpu: Ensure that the object passed to MapBufferEx has already been allocated.
Also added a consistency check and a comment for the case when the object id is different than its handle. The real nvservices doesn't make a distinction between ids and handles, each object gets an unique handle which doubles as its id.
This commit is contained in:
parent
e4bd0bddea
commit
0d6eafe11a
1 changed files with 10 additions and 0 deletions
|
@ -108,6 +108,16 @@ u32 nvhost_as_gpu::MapBufferEx(const std::vector<u8>& input, std::vector<u8>& ou
|
||||||
auto object = nvmap_dev->GetObject(params.nvmap_handle);
|
auto object = nvmap_dev->GetObject(params.nvmap_handle);
|
||||||
ASSERT(object);
|
ASSERT(object);
|
||||||
|
|
||||||
|
// We can only map objects that have already been assigned a CPU address.
|
||||||
|
ASSERT(object->status == nvmap::Object::Status::Allocated);
|
||||||
|
|
||||||
|
ASSERT(params.buffer_offset == 0);
|
||||||
|
|
||||||
|
// The real nvservices doesn't make a distinction between handles and ids, and
|
||||||
|
// object can only have one handle and it will be the same as its id. Assert that this is the
|
||||||
|
// case to prevent unexpected behavior.
|
||||||
|
ASSERT(object->id == params.nvmap_handle);
|
||||||
|
|
||||||
auto& gpu = Core::System::GetInstance().GPU();
|
auto& gpu = Core::System::GetInstance().GPU();
|
||||||
|
|
||||||
if (params.flags & 1) {
|
if (params.flags & 1) {
|
||||||
|
|
Loading…
Reference in a new issue