0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include <nvif/disp.h>
0023 #include <nvif/device.h>
0024 #include <nvif/printf.h>
0025
0026 #include <nvif/class.h>
0027 #include <nvif/if0010.h>
0028
0029 void
0030 nvif_disp_dtor(struct nvif_disp *disp)
0031 {
0032 nvif_object_dtor(&disp->object);
0033 }
0034
0035 int
0036 nvif_disp_ctor(struct nvif_device *device, const char *name, s32 oclass, struct nvif_disp *disp)
0037 {
0038 static const struct nvif_mclass disps[] = {
0039 { GA102_DISP, 0 },
0040 { TU102_DISP, 0 },
0041 { GV100_DISP, 0 },
0042 { GP102_DISP, 0 },
0043 { GP100_DISP, 0 },
0044 { GM200_DISP, 0 },
0045 { GM107_DISP, 0 },
0046 { GK110_DISP, 0 },
0047 { GK104_DISP, 0 },
0048 { GF110_DISP, 0 },
0049 { GT214_DISP, 0 },
0050 { GT206_DISP, 0 },
0051 { GT200_DISP, 0 },
0052 { G82_DISP, 0 },
0053 { NV50_DISP, 0 },
0054 { NV04_DISP, 0 },
0055 {}
0056 };
0057 struct nvif_disp_v0 args;
0058 int cid, ret;
0059
0060 cid = nvif_sclass(&device->object, disps, oclass);
0061 disp->object.client = NULL;
0062 if (cid < 0) {
0063 NVIF_ERRON(cid, &device->object, "[NEW disp%04x] not supported", oclass);
0064 return cid;
0065 }
0066
0067 args.version = 0;
0068
0069 ret = nvif_object_ctor(&device->object, name ?: "nvifDisp", 0,
0070 disps[cid].oclass, &args, sizeof(args), &disp->object);
0071 NVIF_ERRON(ret, &device->object, "[NEW disp%04x]", disps[cid].oclass);
0072 if (ret)
0073 return ret;
0074
0075 NVIF_DEBUG(&disp->object, "[NEW] conn_mask:%08x outp_mask:%08x",
0076 args.conn_mask, args.outp_mask);
0077 disp->conn_mask = args.conn_mask;
0078 disp->outp_mask = args.outp_mask;
0079 return 0;
0080 }