138032Speter/*
2261194Sgshapiro * Copyright 2018 Red Hat Inc.
364562Sgshapiro *
438032Speter * Permission is hereby granted, free of charge, to any person obtaining a
538032Speter * copy of this software and associated documentation files (the "Software"),
638032Speter * to deal in the Software without restriction, including without limitation
738032Speter * the rights to use, copy, modify, merge, publish, distribute, sublicense,
838032Speter * and/or sell copies of the Software, and to permit persons to whom the
938032Speter * Software is furnished to do so, subject to the following conditions:
1038032Speter *
1138032Speter * The above copyright notice and this permission notice shall be included in
1238032Speter * all copies or substantial portions of the Software.
1338032Speter *
1464562Sgshapiro * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15168515Sgshapiro * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1638032Speter * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17266527Sgshapiro * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
1864562Sgshapiro * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1938032Speter * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2038032Speter * OTHER DEALINGS IN THE SOFTWARE.
21363466Sgshapiro */
2238032Speter#include "priv.h"
2390792Sgshapiro
2464562Sgshapiro#include <subdev/gsp.h>
2564562Sgshapiro
26363466Sgshapiro#include <nvif/class.h>
2738032Speter
2838032Speterstatic const struct nvkm_engine_func
2938032Spetertu102_ce = {
30363466Sgshapiro	.intr = gp100_ce_intr,
3164562Sgshapiro	.cclass = &gv100_ce_cclass,
3290792Sgshapiro	.sclass = {
3338032Speter		{ -1, -1, TURING_DMA_COPY_A },
3490792Sgshapiro		{}
35285229Sgshapiro	}
36363466Sgshapiro};
37363466Sgshapiro
38363466Sgshapiroint
39363466Sgshapirotu102_ce_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
40363466Sgshapiro	     struct nvkm_engine **pengine)
4138032Speter{
42363466Sgshapiro	if (nvkm_gsp_rm(device->gsp))
43363466Sgshapiro		return r535_ce_new(&tu102_ce, device, type, inst, pengine);
44363466Sgshapiro
45363466Sgshapiro	return nvkm_engine_new_(&tu102_ce, device, type, inst, true, pengine);
46363466Sgshapiro}
47363466Sgshapiro