gpu: nvgpu: Move channel IOCTL code to Linux module

Move channel IOCTL specific code to Linux module. This clears some
Linux dependencies from channel_gk20a.c.

JIRA NVGPU-32

Change-Id: I41817d612b959709365bcabff9c8a15f2bfe4c60
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1330804
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Terje Bergstrom
2017-03-23 14:19:01 -07:00
committed by mobile promotions
parent f116320137
commit a07e10f494
12 changed files with 1268 additions and 1192 deletions

View File

@@ -28,6 +28,7 @@ nvgpu-y := \
common/linux/ioctl.o \
common/linux/ioctl_ctrl.o \
common/linux/ioctl_as.o \
common/linux/ioctl_channel.o \
common/mm/nvgpu_allocator.o \
common/mm/bitmap_allocator.o \
common/mm/buddy_allocator.o \

View File

@@ -19,6 +19,9 @@
#include <linux/bitops.h>
#include <linux/rculist.h>
#include <linux/llist.h>
#include <linux/uaccess.h>
#include <linux/poll.h>
#include <linux/atomic.h>
#include <nvgpu/lock.h>
#include <nvgpu/kmem.h>

View File

@@ -23,8 +23,8 @@
#include "gk20a/gk20a.h"
#include "gk20a/dbg_gpu_gk20a.h"
#include "gk20a/ctxsw_trace_gk20a.h"
#include "gk20a/channel_gk20a.h"
#include "gk20a/tsg_gk20a.h"
#include "ioctl_channel.h"
#include "ioctl_ctrl.h"
#include "ioctl_as.h"

View File

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,21 @@
/*
* Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#ifndef __NVGPU_IOCTL_CHANNEL_H__
#define __NVGPU_IOCTL_CHANNEL_H__
int gk20a_channel_open(struct inode *inode, struct file *filp);
int gk20a_channel_release(struct inode *inode, struct file *filp);
long gk20a_channel_ioctl(struct file *filp,
unsigned int cmd, unsigned long arg);
#endif

View File

@@ -1224,8 +1224,7 @@ static int gk20a_cde_load(struct gk20a_cde_ctx *cde_ctx)
}
/* allocate gpfifo (1024 should be more than enough) */
err = gk20a_alloc_channel_gpfifo(ch,
&(struct nvgpu_alloc_gpfifo_ex_args){1024, 0, 0, {}});
err = gk20a_channel_alloc_gpfifo(ch, 1024, 0, 0);
if (err) {
gk20a_warn(cde_ctx->dev, "cde: unable to allocate gpfifo");
goto err_alloc_gpfifo;

View File

@@ -471,8 +471,7 @@ u32 gk20a_ce_create_context_with_cb(struct device *dev,
}
/* allocate gpfifo (1024 should be more than enough) */
err = gk20a_alloc_channel_gpfifo(ce_ctx->ch,
&(struct nvgpu_alloc_gpfifo_ex_args){1024, 0, 0, {}});
err = gk20a_channel_alloc_gpfifo(ce_ctx->ch, 1024, 0, 0);
if (err) {
gk20a_err(ce_ctx->dev, "ce: unable to allocate gpfifo");
goto end;

View File

File diff suppressed because it is too large Load Diff

View File

@@ -18,13 +18,8 @@
#ifndef CHANNEL_GK20A_H
#define CHANNEL_GK20A_H
#include <linux/log2.h>
#include <linux/poll.h>
#include <linux/semaphore.h>
#include <linux/slab.h>
#include <linux/stacktrace.h>
#include <linux/wait.h>
#include <uapi/linux/nvgpu.h>
#include <nvgpu/list.h>
#include <nvgpu/lock.h>
@@ -359,8 +354,13 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
bool force_need_sync_fence,
struct fifo_profile_gk20a *profile);
int gk20a_alloc_channel_gpfifo(struct channel_gk20a *c,
struct nvgpu_alloc_gpfifo_ex_args *args);
int gk20a_channel_alloc_gpfifo(struct channel_gk20a *c,
unsigned int num_entries,
unsigned int num_inflight_jobs,
u32 flags);
void gk20a_channel_free_error_notifiers(struct channel_gk20a *ch);
void gk20a_channel_free_cycle_stats_buffer(struct channel_gk20a *ch);
int gk20a_channel_free_cycle_stats_snapshot(struct channel_gk20a *ch);
void gk20a_channel_timeout_restart_all_channels(struct gk20a *g);

View File

@@ -22,6 +22,8 @@
#include <linux/hashtable.h>
#include <linux/debugfs.h>
#include <linux/log2.h>
#include <linux/uaccess.h>
#include <linux/poll.h>
#include <trace/events/gk20a.h>
#include <uapi/linux/nvgpu.h>

View File

@@ -21,6 +21,8 @@
#include <linux/hashtable.h>
#include <linux/debugfs.h>
#include <linux/log2.h>
#include <linux/uaccess.h>
#include <linux/poll.h>
#include <uapi/linux/nvgpu.h>
#include <nvgpu/kmem.h>

View File

@@ -17,6 +17,7 @@
#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/debugfs.h>
#include <linux/uaccess.h>
#include "gk20a/gk20a.h"
#include "gm206/bios_gm206.h"