diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2021-02-04 08:34:38 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2021-02-11 11:49:56 +1000 |
commit | 0b26ca68c97d1673fe644092b05cdd64ad612711 (patch) | |
tree | 24a328474bfc079da55a94484ffee78a9ebd2989 /drivers/gpu/drm/nouveau | |
parent | 608a29c2cb5a735c7f6446ad5019eed10cdb1cd7 (diff) |
drm/nouveau/cipher: switch to instanced constructor
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau')
7 files changed, 12 insertions, 15 deletions
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/device.h b/drivers/gpu/drm/nouveau/include/nvkm/core/device.h index 902976fba46f..bdf051566fc6 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/device.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/device.h @@ -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 **); diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/layout.h b/drivers/gpu/drm/nouveau/include/nvkm/core/layout.h index 72ba4d5feed9..5bc38542b849 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/layout.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/layout.h @@ -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) diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/cipher.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/cipher.h index 66c5c5e27520..9da9176bbbbf 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/engine/cipher.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/cipher.h @@ -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 diff --git a/drivers/gpu/drm/nouveau/nvkm/core/subdev.c b/drivers/gpu/drm/nouveau/nvkm/core/subdev.c index c0129aca8e72..e9990235d1f8 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/subdev.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/subdev.c @@ -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", diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/cipher/g84.c b/drivers/gpu/drm/nouveau/nvkm/engine/cipher/g84.c index 68ffb520531e..be2a7181dc15 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/cipher/g84.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/cipher/g84.c @@ -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); } diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c index 14636df82630..159d048fd7a6 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c @@ -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); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/g84.c b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/g84.c index cd4a5b356472..a04c3bf1f92d 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/g84.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/g84.c @@ -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; } |