Commit 45655ff0 authored by Ben Skeggs's avatar Ben Skeggs Committed by Dave Airlie

drm/nouveau/bar/tu102-: prepare for GSP-RM

- (temporarily) disable if GSP-RM detected, will be added later
- move BAR2 teardown from dtor(), it doesn't belong there
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-7-skeggsb@gmail.com
parent 74e2011b
......@@ -93,8 +93,16 @@ static int
nvkm_bar_fini(struct nvkm_subdev *subdev, bool suspend)
{
struct nvkm_bar *bar = nvkm_bar(subdev);
if (!subdev->use.enabled)
return 0;
if (bar->func->bar1.fini)
bar->func->bar1.fini(bar);
if (!suspend) /* Handled by instmem. */
nvkm_bar_bar2_fini(subdev->device);
return 0;
}
......@@ -120,7 +128,7 @@ static void *
nvkm_bar_dtor(struct nvkm_subdev *subdev)
{
struct nvkm_bar *bar = nvkm_bar(subdev);
nvkm_bar_bar2_fini(subdev->device);
return bar->func->dtor(bar);
}
......
......@@ -22,6 +22,7 @@
#include "gf100.h"
#include <core/memory.h>
#include <subdev/gsp.h>
#include <subdev/timer.h>
static void
......@@ -95,5 +96,8 @@ int
tu102_bar_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_bar **pbar)
{
if (nvkm_gsp_rm(device->gsp))
return -ENODEV;
return gf100_bar_new_(&tu102_bar, device, type, inst, pbar);
}
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