* PGRAPH engine/subdev functions
  ******************************************************************************/
 
+int
+gf100_gr_rops(struct gf100_gr *gr)
+{
+       struct nvkm_device *device = gr->base.engine.subdev.device;
+       return (nvkm_rd32(device, 0x409604) & 0x001f0000) >> 16;
+}
+
 void
 gf100_gr_zbc_init(struct gf100_gr *gr)
 {
                nvkm_wo32(gr->unk4188b8, i, 0x00000010);
        nvkm_done(gr->unk4188b8);
 
-       gr->rop_nr = (nvkm_rd32(device, 0x409604) & 0x001f0000) >> 16;
-       gr->gpc_nr =  nvkm_rd32(device, 0x409604) & 0x0000001f;
+       gr->rop_nr = gr->func->rops(gr);
+       gr->gpc_nr = nvkm_rd32(device, 0x409604) & 0x0000001f;
        for (i = 0; i < gr->gpc_nr; i++) {
                gr->tpc_nr[i]  = nvkm_rd32(device, GPC_UNIT(i, 0x2608));
                gr->tpc_total += gr->tpc_nr[i];
        .mmio = gf100_gr_pack_mmio,
        .fecs.ucode = &gf100_gr_fecs_ucode,
        .gpccs.ucode = &gf100_gr_gpccs_ucode,
+       .rops = gf100_gr_rops,
        .grctx = &gf100_grctx,
        .sclass = {
                { -1, -1, FERMI_TWOD_A },
 
        struct {
                struct gf100_gr_ucode *ucode;
        } gpccs;
+       int (*rops)(struct gf100_gr *);
        int ppc_nr;
        const struct gf100_grctx_func *grctx;
        struct nvkm_sclass sclass[];
 };
 
 int gf100_gr_init(struct gf100_gr *);
+int gf100_gr_rops(struct gf100_gr *);
 
 int gk104_gr_init(struct gf100_gr *);
 
 
        .mmio = gf104_gr_pack_mmio,
        .fecs.ucode = &gf100_gr_fecs_ucode,
        .gpccs.ucode = &gf100_gr_gpccs_ucode,
+       .rops = gf100_gr_rops,
        .grctx = &gf104_grctx,
        .sclass = {
                { -1, -1, FERMI_TWOD_A },
 
        .mmio = gf108_gr_pack_mmio,
        .fecs.ucode = &gf100_gr_fecs_ucode,
        .gpccs.ucode = &gf100_gr_gpccs_ucode,
+       .rops = gf100_gr_rops,
        .grctx = &gf108_grctx,
        .sclass = {
                { -1, -1, FERMI_TWOD_A },
 
        .mmio = gf110_gr_pack_mmio,
        .fecs.ucode = &gf100_gr_fecs_ucode,
        .gpccs.ucode = &gf100_gr_gpccs_ucode,
+       .rops = gf100_gr_rops,
        .grctx = &gf110_grctx,
        .sclass = {
                { -1, -1, FERMI_TWOD_A },
 
        .mmio = gf117_gr_pack_mmio,
        .fecs.ucode = &gf117_gr_fecs_ucode,
        .gpccs.ucode = &gf117_gr_gpccs_ucode,
+       .rops = gf100_gr_rops,
        .ppc_nr = 1,
        .grctx = &gf117_grctx,
        .sclass = {
 
        .mmio = gf119_gr_pack_mmio,
        .fecs.ucode = &gf100_gr_fecs_ucode,
        .gpccs.ucode = &gf100_gr_gpccs_ucode,
+       .rops = gf100_gr_rops,
        .grctx = &gf119_grctx,
        .sclass = {
                { -1, -1, FERMI_TWOD_A },
 
        .mmio = gk104_gr_pack_mmio,
        .fecs.ucode = &gk104_gr_fecs_ucode,
        .gpccs.ucode = &gk104_gr_gpccs_ucode,
+       .rops = gf100_gr_rops,
        .ppc_nr = 1,
        .grctx = &gk104_grctx,
        .sclass = {
 
        .mmio = gk110_gr_pack_mmio,
        .fecs.ucode = &gk110_gr_fecs_ucode,
        .gpccs.ucode = &gk110_gr_gpccs_ucode,
+       .rops = gf100_gr_rops,
        .ppc_nr = 2,
        .grctx = &gk110_grctx,
        .sclass = {
 
        .mmio = gk110b_gr_pack_mmio,
        .fecs.ucode = &gk110_gr_fecs_ucode,
        .gpccs.ucode = &gk110_gr_gpccs_ucode,
+       .rops = gf100_gr_rops,
        .ppc_nr = 2,
        .grctx = &gk110b_grctx,
        .sclass = {
 
        .mmio = gk208_gr_pack_mmio,
        .fecs.ucode = &gk208_gr_fecs_ucode,
        .gpccs.ucode = &gk208_gr_gpccs_ucode,
+       .rops = gf100_gr_rops,
        .ppc_nr = 1,
        .grctx = &gk208_grctx,
        .sclass = {
 
 gk20a_gr = {
        .init = gk20a_gr_init,
        .set_hww_esr_report_mask = gk20a_gr_set_hww_esr_report_mask,
+       .rops = gf100_gr_rops,
        .ppc_nr = 1,
        .grctx = &gk20a_grctx,
        .sclass = {
 
        .mmio = gm107_gr_pack_mmio,
        .fecs.ucode = &gm107_gr_fecs_ucode,
        .gpccs.ucode = &gm107_gr_gpccs_ucode,
+       .rops = gf100_gr_rops,
        .ppc_nr = 2,
        .grctx = &gm107_grctx,
        .sclass = {
 
 static const struct gf100_gr_func
 gm200_gr = {
        .init = gm200_gr_init,
+       .rops = gf100_gr_rops,
        .ppc_nr = 2,
        .grctx = &gm200_grctx,
        .sclass = {
 
        .init = gk20a_gr_init,
        .init_gpc_mmu = gm20b_gr_init_gpc_mmu,
        .set_hww_esr_report_mask = gm20b_gr_set_hww_esr_report_mask,
+       .rops = gf100_gr_rops,
        .ppc_nr = 1,
        .grctx = &gm20b_grctx,
        .sclass = {