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: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-7-skeggsb@gmail.com
This commit is contained in:
parent
74e2011b11
commit
45655ff084
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user