aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/gpu/drm/nouveau/nouveau_drm.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2020-06-22 19:48:59 +1000
committerBen Skeggs <bskeggs@redhat.com>2020-07-24 18:50:57 +1000
commit2bf00037c47f3252b75de3cc15da247c61d16fce (patch)
treebf47d7955cd4e88a5492bd4391f65d3a2d7d2d77 /drivers/gpu/drm/nouveau/nouveau_drm.c
parentdrm/nouveau/kms/nv04: convert page_flip() to new push macros (diff)
downloadwireguard-linux-2bf00037c47f3252b75de3cc15da247c61d16fce.tar.xz
wireguard-linux-2bf00037c47f3252b75de3cc15da247c61d16fce.zip
drm/nouveau/kms/nv04-: no need for multiple nvsw objects
Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_drm.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_drm.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index c1b22746a710..3879919050a9 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -331,7 +331,6 @@ nouveau_accel_gr_fini(struct nouveau_drm *drm)
nouveau_channel_idle(drm->channel);
nvif_object_dtor(&drm->ntfy);
nvkm_gpuobj_del(&drm->notify);
- nvif_object_dtor(&drm->nvsw);
nouveau_channel_del(&drm->channel);
}
@@ -363,15 +362,15 @@ nouveau_accel_gr_init(struct nouveau_drm *drm)
* synchronisation of page flips, as well as to implement fences
* on TNT/TNT2 HW that lacks any kind of support in host.
*/
- if (device->info.family < NV_DEVICE_INFO_V0_TESLA) {
+ if (!drm->channel->nvsw.client && device->info.family < NV_DEVICE_INFO_V0_TESLA) {
ret = nvif_object_ctor(&drm->channel->user, "drmNvsw",
NVDRM_NVSW, nouveau_abi16_swclass(drm),
- NULL, 0, &drm->nvsw);
+ NULL, 0, &drm->channel->nvsw);
if (ret == 0) {
ret = RING_SPACE(drm->channel, 2);
if (ret == 0) {
BEGIN_NV04(drm->channel, NvSubSw, 0, 1);
- OUT_RING (drm->channel, drm->nvsw.handle);
+ OUT_RING (drm->channel, drm->channel->nvsw.handle);
}
}