mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 18:16:01 +03:00
gpu: nvgpu: extract priv cmdbuf from channel.c
Move private command buffer related functionality to priv_cmdbuf.c. This is used only for kernel mode submits, so it makes sense to group it out, and the priv cmdbuf stuff is used also by things that don't care about channels. Jira NVGPU-4548 Change-Id: Idbb42e3ed3984e16c654bb9aa2b7564b780048a4 Signed-off-by: Konsta Hölttä <kholtta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2323146 (cherry picked from commit bb67bfc7ab8e87236f31bc4f6c80dab042609f21) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2328406 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> GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Alex Waterman
parent
7fc3c3822d
commit
b3d16b23d5
@@ -46,6 +46,7 @@ struct nvgpu_gpfifo_userdata;
|
||||
struct nvgpu_gr_subctx;
|
||||
struct nvgpu_gr_ctx;
|
||||
struct nvgpu_debug_context;
|
||||
struct priv_cmd_entry;
|
||||
|
||||
/**
|
||||
* S/W defined invalid channel identifier.
|
||||
@@ -257,15 +258,6 @@ struct priv_cmd_queue {
|
||||
u32 get; /* get for priv cmd queue */
|
||||
};
|
||||
|
||||
struct priv_cmd_entry {
|
||||
bool valid;
|
||||
struct nvgpu_mem *mem;
|
||||
u32 off; /* offset in mem, in u32 entries */
|
||||
u64 gva;
|
||||
u32 get; /* start of entry in queue */
|
||||
u32 size; /* in words */
|
||||
};
|
||||
|
||||
struct nvgpu_channel_job {
|
||||
struct nvgpu_mapped_buf **mapped_buffers;
|
||||
u32 num_mapped_buffers;
|
||||
@@ -619,10 +611,6 @@ nvgpu_channel_from_worker_item(struct nvgpu_list_node *node)
|
||||
return (struct nvgpu_channel *)
|
||||
((uintptr_t)node - offsetof(struct nvgpu_channel, worker_item));
|
||||
};
|
||||
int nvgpu_channel_alloc_priv_cmdbuf(struct nvgpu_channel *c, u32 orig_size,
|
||||
struct priv_cmd_entry *e);
|
||||
void nvgpu_channel_update_priv_cmd_q_and_free_entry(
|
||||
struct nvgpu_channel *ch, struct priv_cmd_entry *e);
|
||||
int nvgpu_channel_worker_init(struct gk20a *g);
|
||||
void nvgpu_channel_worker_deinit(struct gk20a *g);
|
||||
void nvgpu_channel_update(struct nvgpu_channel *c);
|
||||
@@ -636,8 +624,6 @@ u32 nvgpu_channel_get_gpfifo_free_count(struct nvgpu_channel *ch);
|
||||
int nvgpu_channel_add_job(struct nvgpu_channel *c,
|
||||
struct nvgpu_channel_job *job,
|
||||
bool skip_buffer_refcounting);
|
||||
void nvgpu_channel_free_priv_cmd_entry(struct nvgpu_channel *c,
|
||||
struct priv_cmd_entry *e);
|
||||
void nvgpu_channel_clean_up_jobs(struct nvgpu_channel *c,
|
||||
bool clean_all);
|
||||
int nvgpu_submit_channel_gpfifo_user(struct nvgpu_channel *c,
|
||||
|
||||
51
drivers/gpu/nvgpu/include/nvgpu/priv_cmdbuf.h
Normal file
51
drivers/gpu/nvgpu/include/nvgpu/priv_cmdbuf.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef NVGPU_PRIV_CMDBUF_H
|
||||
#define NVGPU_PRIV_CMDBUF_H
|
||||
|
||||
#include <nvgpu/types.h>
|
||||
|
||||
struct gk20a;
|
||||
struct nvgpu_mem;
|
||||
struct nvgpu_channel;
|
||||
|
||||
struct priv_cmd_entry {
|
||||
bool valid;
|
||||
struct nvgpu_mem *mem;
|
||||
u32 off; /* offset in mem, in u32 entries */
|
||||
u64 gva;
|
||||
u32 get; /* start of entry in queue */
|
||||
u32 size; /* in words */
|
||||
};
|
||||
|
||||
int channel_alloc_priv_cmdbuf(struct nvgpu_channel *ch, u32 num_in_flight);
|
||||
void channel_free_priv_cmd_q(struct nvgpu_channel *ch);
|
||||
|
||||
int nvgpu_channel_alloc_priv_cmdbuf(struct nvgpu_channel *c, u32 orig_size,
|
||||
struct priv_cmd_entry *e);
|
||||
void nvgpu_channel_free_priv_cmd_entry(struct nvgpu_channel *c,
|
||||
struct priv_cmd_entry *e);
|
||||
void nvgpu_channel_update_priv_cmd_q_and_free_entry(struct nvgpu_channel *ch,
|
||||
struct priv_cmd_entry *e);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user