mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
gpu: nvgpu: add user fence type
Decouple the fence information needed for providing submit postfences to userspace by adding a separate type for that and using it to pass fence data to ioctls. The data in struct nvgpu_fence_type is used in various places: - job tracking needs to know when a post fence is expired - job submitters within the driver (vidmem clears) need to be able to wait for these fences - userspace needs the fence as an id, value pair or as a file descriptor created from an os fence To keep object lifetimes strict, start decoupling the os fence data out of struct nvgpu_fence_type: delete nvgpu_fence_install_fd() and add nvgpu_fence_extract_user() to return a struct nvgpu_user_fence that contains only the necessary information. Storing the os fence in job tracking metadata is legacy code and not useful. Passing the os fence from where it's created through the whole submit path inside this combined fence type has been convenient, though. The internally stored cde job fence in dmabuf compression metadata is still nvgpu_fence_type to keep this patch simple. Jira NVGPU-5248 Change-Id: I75b7da676fb6aa083828f888c55571bbf7645ef3 Signed-off-by: Konsta Hölttä <kholtta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2359064 Reviewed-by: automaticguardword <automaticguardword@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
Alex Waterman
parent
8c224adb91
commit
ca1f93bdd7
@@ -48,6 +48,7 @@ struct nvgpu_channel_fence;
|
||||
struct nvgpu_channel;
|
||||
struct vm_gk20a;
|
||||
struct nvgpu_gpfifo_entry;
|
||||
struct nvgpu_user_fence;
|
||||
|
||||
/*
|
||||
* this element defines a buffer that is allocated and mapped into gpu address
|
||||
@@ -317,7 +318,7 @@ int gk20a_prepare_compressible_read(
|
||||
u32 width, u32 height, u32 block_height_log2,
|
||||
u32 submit_flags, struct nvgpu_channel_fence *fence,
|
||||
u32 *valid_compbits, u32 *zbc_color,
|
||||
struct nvgpu_fence_type **fence_out);
|
||||
struct nvgpu_user_fence *fence_out);
|
||||
int gk20a_mark_compressible_write(
|
||||
struct gk20a *g, u32 buffer_fd, u32 valid_compbits, u64 offset,
|
||||
u32 zbc_color);
|
||||
|
||||
Reference in New Issue
Block a user