0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include "core.h"
0023 #include "head.h"
0024
0025 #include <nvif/push507c.h>
0026 #include <nvif/timer.h>
0027
0028 #include <nvhw/class/cl907d.h>
0029
0030 #include "nouveau_bo.h"
0031
0032 int
0033 core907d_caps_init(struct nouveau_drm *drm, struct nv50_disp *disp)
0034 {
0035 struct nv50_core *core = disp->core;
0036 struct nouveau_bo *bo = disp->sync;
0037 s64 time;
0038 int ret;
0039
0040 NVBO_WR32(bo, NV50_DISP_CORE_NTFY, NV907D_CORE_NOTIFIER_3, CAPABILITIES_4,
0041 NVDEF(NV907D_CORE_NOTIFIER_3, CAPABILITIES_4, DONE, FALSE));
0042
0043 ret = core507d_read_caps(disp);
0044 if (ret < 0)
0045 return ret;
0046
0047 time = nvif_msec(core->chan.base.device, 2000ULL,
0048 if (NVBO_TD32(bo, NV50_DISP_CORE_NTFY,
0049 NV907D_CORE_NOTIFIER_3, CAPABILITIES_4, DONE, ==, TRUE))
0050 break;
0051 usleep_range(1, 2);
0052 );
0053 if (time < 0)
0054 NV_ERROR(drm, "core caps notifier timeout\n");
0055
0056 return 0;
0057 }
0058
0059 static const struct nv50_core_func
0060 core907d = {
0061 .init = core507d_init,
0062 .ntfy_init = core507d_ntfy_init,
0063 .caps_init = core907d_caps_init,
0064 .ntfy_wait_done = core507d_ntfy_wait_done,
0065 .update = core507d_update,
0066 .head = &head907d,
0067 #if IS_ENABLED(CONFIG_DEBUG_FS)
0068 .crc = &crc907d,
0069 #endif
0070 .dac = &dac907d,
0071 .sor = &sor907d,
0072 };
0073
0074 int
0075 core907d_new(struct nouveau_drm *drm, s32 oclass, struct nv50_core **pcore)
0076 {
0077 return core507d_new_(&core907d, drm, oclass, pcore);
0078 }