FILE
nvenc.c
File preview with syntax highlighting.
linux-6.19.14/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/nvenc.c
1/* SPDX-License-Identifier: MIT 2 * 3 * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. 4 */ 5#include "engine.h" 6#include <engine/nvenc.h> 7 8static void * 9nvkm_rm_nvenc_dtor(struct nvkm_engine *engine) 10{ 11 return container_of(engine, struct nvkm_nvenc, engine); 12} 13 14int 15nvkm_rm_nvenc_new(struct nvkm_rm *rm, int inst) 16{ 17 struct nvkm_nvenc *nvenc; 18 int ret; 19 20 nvenc = kzalloc(sizeof(*nvenc), GFP_KERNEL); 21 if (!nvenc) 22 return -ENOMEM; 23 24 ret = nvkm_rm_engine_ctor(nvkm_rm_nvenc_dtor, rm, NVKM_ENGINE_NVENC, inst, 25 &rm->gpu->nvenc.class, 1, &nvenc->engine); 26 if (ret) { 27 kfree(nvenc); 28 return ret; 29 } 30 31 rm->device->nvenc[inst] = nvenc; 32 return 0; 33}
~/
Read-only file preview.