All calling code assumes that the rasterizer will be in a valid state,
which is a totally fine assumption. The only way the rasterizer wouldn't
be is if initialization is done incorrectly or fails, which is checked
against in System::Init().
We move the initialization of the renderer to the core class, while
keeping the creation of it and any other specifics in video_core. This
way we can ensure that the renderer is initialized and doesn't give
unfettered access to the renderer. This also makes dependencies on types
more explicit.
For example, the GPU class doesn't need to depend on the
existence of a renderer, it only needs to care about whether or not it
has a rasterizer, but since it was accessing the global variable, it was
also making the renderer a part of its dependency chain. By adjusting
the interface, we can get rid of this dependency.
Avoids copies from being made, since the string is only ever used for
lookup, the data is never transfered anywhere.
Ideally, we'd use a std::string_view here, but devices is a
std::unordered_map, not a std::map, so we can't use heterogenous lookup
here.
Avoids unnecessary reference count increments and decrements.
In one case, we don't need to make a shared_ptr copy at all,
just to call a member function.
* add IoctlCommands with their params in nvidia_ctrl_gpu.h
* add function related to the changes done previously
* fix clang-format
* delete trailing whitespace
* correct mistake
* Add some IoctlCommand with their params to nvhost_gpu
* fix clang-format
* delete trailing whitespace
* fix some clang-format
* delete one other trailing whitespace
* last clang-format fix
* Implemented NVHOST_IOCTL_CHANNEL_GET_WAITBASE
struct + 4 seems to be hard coded at 0 and struct + 0 seems to be ignored?
* IocGetWaitbase -> IocChannelGetWaitbaseCommand
* Added super late fixes
This makes the formatting expectations more obvious (e.g. any zero padding specified
is padding that's entirely dedicated to the value being printed, not any pretty-printing
that also gets tacked on).
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.