Skip to content

Commit

Permalink
drm/nouveau/bar/tu102-: prepare for GSP-RM
Browse files Browse the repository at this point in the history
- (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
  • Loading branch information
Ben Skeggs authored and Dave Airlie committed Oct 31, 2023
1 parent 74e2011 commit 45655ff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 9 additions & 1 deletion drivers/gpu/drm/nouveau/nvkm/subdev/bar/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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);
}

Expand Down
4 changes: 4 additions & 0 deletions drivers/gpu/drm/nouveau/nvkm/subdev/bar/tu102.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "gf100.h"

#include <core/memory.h>
#include <subdev/gsp.h>
#include <subdev/timer.h>

static void
Expand Down Expand Up @@ -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);
}

0 comments on commit 45655ff

Please sign in to comment.