Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nouveau allocator driver #16

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

mvicomoya
Copy link

@mvicomoya mvicomoya commented Jun 19, 2018

  • A series of refactoring changes to allow multiple allocator drivers to cohexist
  • Implementation of an allocator driver based off nouveau
  • Test enhancements

Miguel A. Vico added 10 commits June 19, 2018 15:33
Rather than searching for drivers under a single
hardcoded directory, this change modifies
init_drivers() such that it searches under the
following ones:

  System:
    - /usr/share/liballocator
    - /usr/local/share/liballocator

  User:
    - $HOME/.liballocator

And also allows users to set extra directories by
setting the following environment variable with a
colon-delimited list of paths:

  __LIBALLOCATOR_EXTRA_CONF_DIRS

Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
This changes moves the following functions to a
new helpers.h header file and makes them static
inline functions so they can be used by others
(i.e. drivers and tests) without having to link
against the allocator library:

  * free_capability_sets()
  * serialize_capability_set()
  * deserialize_capability_set()

Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
Drivers will want to stick a copy of the given
capability set when creating an allocation. This
change adds a dup_capability_set() static inline
helper.

Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
Add a new utils.h header file with miscellaneous
macros and static inline utility functions to be
used by tests and drivers.

Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
Adds the infrastructure to build an allocator driver
based off nouveau.

Current driver implementation is just a bunch of
placeholders. The actual logic will be added
incrementally with follow-on changes.

Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
Add nouveau_driver_t and nouveau_device_t structures
and the required logic to allocate a nouveau
allocator device.

Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
Add the code to nouveau_device_get_capabilities()
to return a capability set to support a pitch
linear memory layout.

Note this change also implements
nouveau_device_get_assertion_hints() so that we
can also expose the allocation maximum size
supported.

./capability_set_ops test now runs and succeeds
when using the nouveau driver.

Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
Add the necessary logic to create an allocator
allocation backed by a nouveau buffer object.

Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
Make the -f|--file option an optional one. If only
-d|--drm-file is specified, assume both the drm
and the allocator devices are the same (also if
both options are specified but both point to the
same device node).

Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
Add USAGE_BASE_DISPLAY to the list of usages to
test in capability_set_ops.

Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
@mvicomoya
Copy link
Author

Exported to https://gitlab.freedesktop.org/allocator/allocator/merge_requests/17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant