Commit 0b26ca68 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/cipher: switch to instanced constructor

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent 608a29c2
......@@ -60,7 +60,6 @@ struct nvkm_device {
struct notifier_block nb;
} acpi;
struct nvkm_engine *cipher;
struct nvkm_disp *disp;
struct nvkm_dma *dma;
struct nvkm_fifo *fifo;
......@@ -120,7 +119,6 @@ struct nvkm_device_chip {
#undef NVKM_LAYOUT_INST
#undef NVKM_LAYOUT_ONCE
int (*cipher )(struct nvkm_device *, int idx, struct nvkm_engine **);
int (*disp )(struct nvkm_device *, int idx, struct nvkm_disp **);
int (*dma )(struct nvkm_device *, int idx, struct nvkm_dma **);
int (*fifo )(struct nvkm_device *, int idx, struct nvkm_fifo **);
......
......@@ -27,4 +27,5 @@ NVKM_LAYOUT_ONCE(NVKM_SUBDEV_GSP , struct nvkm_gsp , gsp)
NVKM_LAYOUT_ONCE(NVKM_ENGINE_BSP , struct nvkm_engine , bsp)
NVKM_LAYOUT_INST(NVKM_ENGINE_CE , struct nvkm_engine , ce, 9)
NVKM_LAYOUT_ONCE(NVKM_ENGINE_CIPHER , struct nvkm_engine , cipher)
NVKM_LAYOUT_ONCE(NVKM_ENGINE_VP , struct nvkm_engine , vp)
......@@ -2,5 +2,5 @@
#ifndef __NVKM_CIPHER_H__
#define __NVKM_CIPHER_H__
#include <core/engine.h>
int g84_cipher_new(struct nvkm_device *, int, struct nvkm_engine **);
int g84_cipher_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_engine **);
#endif
......@@ -33,7 +33,6 @@ nvkm_subdev_type[NVKM_SUBDEV_NR] = {
#include <core/layout.h>
#undef NVKM_LAYOUT_ONCE
#undef NVKM_LAYOUT_INST
[NVKM_ENGINE_CIPHER ] = "cipher",
[NVKM_ENGINE_DISP ] = "disp",
[NVKM_ENGINE_DMAOBJ ] = "dma",
[NVKM_ENGINE_FIFO ] = "fifo",
......
......@@ -127,8 +127,8 @@ g84_cipher = {
};
int
g84_cipher_new(struct nvkm_device *device, int index,
g84_cipher_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_engine **pengine)
{
return nvkm_engine_new_(&g84_cipher, device, index, true, pengine);
return nvkm_engine_new_(&g84_cipher, device, type, inst, true, pengine);
}
......@@ -935,7 +935,7 @@ nv84_chipset = {
.timer = { 0x00000001, nv41_timer_new },
.volt = { 0x00000001, nv40_volt_new },
.bsp = { 0x00000001, g84_bsp_new },
.cipher = g84_cipher_new,
.cipher = { 0x00000001, g84_cipher_new },
.disp = g84_disp_new,
.dma = nv50_dma_new,
.fifo = g84_fifo_new,
......@@ -967,7 +967,7 @@ nv86_chipset = {
.timer = { 0x00000001, nv41_timer_new },
.volt = { 0x00000001, nv40_volt_new },
.bsp = { 0x00000001, g84_bsp_new },
.cipher = g84_cipher_new,
.cipher = { 0x00000001, g84_cipher_new },
.disp = g84_disp_new,
.dma = nv50_dma_new,
.fifo = g84_fifo_new,
......@@ -999,7 +999,7 @@ nv92_chipset = {
.timer = { 0x00000001, nv41_timer_new },
.volt = { 0x00000001, nv40_volt_new },
.bsp = { 0x00000001, g84_bsp_new },
.cipher = g84_cipher_new,
.cipher = { 0x00000001, g84_cipher_new },
.disp = g84_disp_new,
.dma = nv50_dma_new,
.fifo = g84_fifo_new,
......@@ -1031,7 +1031,7 @@ nv94_chipset = {
.timer = { 0x00000001, nv41_timer_new },
.volt = { 0x00000001, nv40_volt_new },
.bsp = { 0x00000001, g84_bsp_new },
.cipher = g84_cipher_new,
.cipher = { 0x00000001, g84_cipher_new },
.disp = g94_disp_new,
.dma = nv50_dma_new,
.fifo = g84_fifo_new,
......@@ -1063,7 +1063,7 @@ nv96_chipset = {
.timer = { 0x00000001, nv41_timer_new },
.volt = { 0x00000001, nv40_volt_new },
.bsp = { 0x00000001, g84_bsp_new },
.cipher = g84_cipher_new,
.cipher = { 0x00000001, g84_cipher_new },
.disp = g94_disp_new,
.dma = nv50_dma_new,
.fifo = g84_fifo_new,
......@@ -1127,7 +1127,7 @@ nva0_chipset = {
.timer = { 0x00000001, nv41_timer_new },
.volt = { 0x00000001, nv40_volt_new },
.bsp = { 0x00000001, g84_bsp_new },
.cipher = g84_cipher_new,
.cipher = { 0x00000001, g84_cipher_new },
.disp = gt200_disp_new,
.dma = nv50_dma_new,
.fifo = g84_fifo_new,
......@@ -3174,7 +3174,6 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
#include <core/layout.h>
#undef NVKM_LAYOUT_INST
#undef NVKM_LAYOUT_ONCE
_(NVKM_ENGINE_CIPHER , cipher);
_(NVKM_ENGINE_DISP , disp);
_(NVKM_ENGINE_DMAOBJ , dma);
_(NVKM_ENGINE_FIFO , fifo);
......
......@@ -38,7 +38,7 @@ g84_devinit_disable(struct nvkm_devinit *init)
disable |= (1ULL << NVKM_ENGINE_MPEG);
nvkm_subdev_disable(device, NVKM_ENGINE_VP, 0);
nvkm_subdev_disable(device, NVKM_ENGINE_BSP, 0);
disable |= (1ULL << NVKM_ENGINE_CIPHER);
nvkm_subdev_disable(device, NVKM_ENGINE_CIPHER, 0);
}
if (!(r00154c & 0x00000004))
......@@ -46,7 +46,7 @@ g84_devinit_disable(struct nvkm_devinit *init)
if (!(r00154c & 0x00000020))
nvkm_subdev_disable(device, NVKM_ENGINE_BSP, 0);
if (!(r00154c & 0x00000040))
disable |= (1ULL << NVKM_ENGINE_CIPHER);
nvkm_subdev_disable(device, NVKM_ENGINE_CIPHER, 0);
return disable;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment