Commit a35047ba authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/mc: use split type+inst in interrupt masking API

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent 6997ea13
...@@ -15,7 +15,7 @@ void nvkm_mc_reset(struct nvkm_device *, enum nvkm_subdev_type, int); ...@@ -15,7 +15,7 @@ void nvkm_mc_reset(struct nvkm_device *, enum nvkm_subdev_type, int);
void nvkm_mc_intr(struct nvkm_device *, bool *handled); void nvkm_mc_intr(struct nvkm_device *, bool *handled);
void nvkm_mc_intr_unarm(struct nvkm_device *); void nvkm_mc_intr_unarm(struct nvkm_device *);
void nvkm_mc_intr_rearm(struct nvkm_device *); void nvkm_mc_intr_rearm(struct nvkm_device *);
void nvkm_mc_intr_mask(struct nvkm_device *, enum nvkm_devidx, bool enable); void nvkm_mc_intr_mask(struct nvkm_device *, enum nvkm_subdev_type, int, bool enable);
void nvkm_mc_unk260(struct nvkm_device *, u32 data); void nvkm_mc_unk260(struct nvkm_device *, u32 data);
int nv04_mc_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_mc **); int nv04_mc_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_mc **);
......
...@@ -25,7 +25,7 @@ struct nvkm_top_device { ...@@ -25,7 +25,7 @@ struct nvkm_top_device {
u32 nvkm_top_addr(struct nvkm_device *, enum nvkm_devidx); u32 nvkm_top_addr(struct nvkm_device *, enum nvkm_devidx);
u32 nvkm_top_reset(struct nvkm_device *, enum nvkm_subdev_type, int); u32 nvkm_top_reset(struct nvkm_device *, enum nvkm_subdev_type, int);
u32 nvkm_top_intr(struct nvkm_device *, u32 intr, u64 *subdevs); u32 nvkm_top_intr(struct nvkm_device *, u32 intr, u64 *subdevs);
u32 nvkm_top_intr_mask(struct nvkm_device *, enum nvkm_devidx); u32 nvkm_top_intr_mask(struct nvkm_device *, enum nvkm_subdev_type, int);
int nvkm_top_fault_id(struct nvkm_device *, enum nvkm_devidx); int nvkm_top_fault_id(struct nvkm_device *, enum nvkm_devidx);
enum nvkm_devidx nvkm_top_fault(struct nvkm_device *, int fault); enum nvkm_devidx nvkm_top_fault(struct nvkm_device *, int fault);
enum nvkm_devidx nvkm_top_engine(struct nvkm_device *, int, int *runl, int *engn); enum nvkm_devidx nvkm_top_engine(struct nvkm_device *, int, int *runl, int *engn);
......
...@@ -262,7 +262,7 @@ gm200_acr_hsfw_boot(struct nvkm_acr *acr, struct nvkm_acr_hsf *hsf, ...@@ -262,7 +262,7 @@ gm200_acr_hsfw_boot(struct nvkm_acr *acr, struct nvkm_acr_hsf *hsf,
hsf->func->bld(acr, hsf); hsf->func->bld(acr, hsf);
/* Boot the falcon. */ /* Boot the falcon. */
nvkm_mc_intr_mask(device, falcon->owner->index, false); nvkm_mc_intr_mask(device, falcon->owner->type, falcon->owner->inst, false);
nvkm_falcon_wr32(falcon, 0x040, 0xdeada5a5); nvkm_falcon_wr32(falcon, 0x040, 0xdeada5a5);
nvkm_falcon_set_start_addr(falcon, hsf->imem_tag << 8); nvkm_falcon_set_start_addr(falcon, hsf->imem_tag << 8);
...@@ -279,7 +279,7 @@ gm200_acr_hsfw_boot(struct nvkm_acr *acr, struct nvkm_acr_hsf *hsf, ...@@ -279,7 +279,7 @@ gm200_acr_hsfw_boot(struct nvkm_acr *acr, struct nvkm_acr_hsf *hsf,
return -EIO; return -EIO;
nvkm_falcon_clear_interrupt(falcon, intr_clear); nvkm_falcon_clear_interrupt(falcon, intr_clear);
nvkm_mc_intr_mask(device, falcon->owner->index, true); nvkm_mc_intr_mask(device, falcon->owner->type, falcon->owner->inst, true);
return ret; return ret;
} }
......
...@@ -30,7 +30,7 @@ void ...@@ -30,7 +30,7 @@ void
gp100_fault_buffer_intr(struct nvkm_fault_buffer *buffer, bool enable) gp100_fault_buffer_intr(struct nvkm_fault_buffer *buffer, bool enable)
{ {
struct nvkm_device *device = buffer->fault->subdev.device; struct nvkm_device *device = buffer->fault->subdev.device;
nvkm_mc_intr_mask(device, NVKM_SUBDEV_FAULT, enable); nvkm_mc_intr_mask(device, NVKM_SUBDEV_FAULT, 0, enable);
} }
void void
......
...@@ -37,7 +37,7 @@ tu102_fault_buffer_intr(struct nvkm_fault_buffer *buffer, bool enable) ...@@ -37,7 +37,7 @@ tu102_fault_buffer_intr(struct nvkm_fault_buffer *buffer, bool enable)
*/ */
struct nvkm_device *device = buffer->fault->subdev.device; struct nvkm_device *device = buffer->fault->subdev.device;
nvkm_mc_intr_mask(device, NVKM_SUBDEV_FAULT, enable); nvkm_mc_intr_mask(device, NVKM_SUBDEV_FAULT, 0, enable);
} }
static void static void
......
...@@ -35,14 +35,14 @@ nvkm_mc_unk260(struct nvkm_device *device, u32 data) ...@@ -35,14 +35,14 @@ nvkm_mc_unk260(struct nvkm_device *device, u32 data)
} }
void void
nvkm_mc_intr_mask(struct nvkm_device *device, enum nvkm_devidx devidx, bool en) nvkm_mc_intr_mask(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, bool en)
{ {
struct nvkm_mc *mc = device->mc; struct nvkm_mc *mc = device->mc;
const struct nvkm_mc_map *map; const struct nvkm_mc_map *map;
if (likely(mc) && mc->func->intr_mask) { if (likely(mc) && mc->func->intr_mask) {
u32 mask = nvkm_top_intr_mask(device, devidx); u32 mask = nvkm_top_intr_mask(device, type, inst);
for (map = mc->func->intr; !mask && map->stat; map++) { for (map = mc->func->intr; !mask && map->stat; map++) {
if (map->type + map->inst == devidx) if (map->type == type && map->inst == inst)
mask = map->stat; mask = map->stat;
} }
mc->func->intr_mask(mc, mask, en ? mask : 0); mc->func->intr_mask(mc, mask, en ? mask : 0);
......
...@@ -75,14 +75,14 @@ nvkm_top_reset(struct nvkm_device *device, enum nvkm_subdev_type type, int inst) ...@@ -75,14 +75,14 @@ nvkm_top_reset(struct nvkm_device *device, enum nvkm_subdev_type type, int inst)
} }
u32 u32
nvkm_top_intr_mask(struct nvkm_device *device, enum nvkm_devidx devidx) nvkm_top_intr_mask(struct nvkm_device *device, enum nvkm_subdev_type type, int inst)
{ {
struct nvkm_top *top = device->top; struct nvkm_top *top = device->top;
struct nvkm_top_device *info; struct nvkm_top_device *info;
if (top) { if (top) {
list_for_each_entry(info, &top->device, head) { list_for_each_entry(info, &top->device, head) {
if (info->index == devidx && info->intr >= 0) if (info->type == type && info->inst == inst && info->intr >= 0)
return BIT(info->intr); return BIT(info->intr);
} }
} }
......
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