diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagt215.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagt215.c | 74 |
1 files changed, 23 insertions, 51 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagt215.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagt215.c index f8f2f16c22a2..4509d2ba880e 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagt215.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagt215.c @@ -21,59 +21,31 @@ * * Authors: Ben Skeggs */ -#include "nv50.h" -#include "outp.h" +#include "ior.h" -#include <core/client.h> -#include <subdev/timer.h> - -#include <nvif/cl5070.h> -#include <nvif/unpack.h> - -int -gt215_hda_eld(NV50_DISP_MTHD_V1) +void +gt215_hda_eld(struct nvkm_ior *ior, u8 *data, u8 size) { - struct nvkm_device *device = disp->base.engine.subdev.device; - union { - struct nv50_disp_sor_hda_eld_v0 v0; - } *args = data; - const u32 soff = outp->or * 0x800; - int ret = -ENOSYS, i; - - nvif_ioctl(object, "disp sor hda eld size %d\n", size); - if (!(ret = nvif_unpack(ret, &data, &size, args->v0, 0, 0, true))) { - nvif_ioctl(object, "disp sor hda eld vers %d\n", - args->v0.version); - if (size > 0x60) - return -E2BIG; - } else - return ret; + struct nvkm_device *device = ior->disp->engine.subdev.device; + const u32 soff = ior->id * 0x800; + int i; - if (size && args->v0.data[0]) { - if (outp->info.type == DCB_OUTPUT_DP) { - nvkm_mask(device, 0x61c1e0 + soff, 0x8000000d, 0x80000001); - nvkm_msec(device, 2000, - u32 tmp = nvkm_rd32(device, 0x61c1e0 + soff); - if (!(tmp & 0x80000000)) - break; - ); - } - for (i = 0; i < size; i++) - nvkm_wr32(device, 0x61c440 + soff, (i << 8) | args->v0.data[i]); - for (; i < 0x60; i++) - nvkm_wr32(device, 0x61c440 + soff, (i << 8)); - nvkm_mask(device, 0x61c448 + soff, 0x80000003, 0x80000003); - } else { - if (outp->info.type == DCB_OUTPUT_DP) { - nvkm_mask(device, 0x61c1e0 + soff, 0x80000001, 0x80000000); - nvkm_msec(device, 2000, - u32 tmp = nvkm_rd32(device, 0x61c1e0 + soff); - if (!(tmp & 0x80000000)) - break; - ); - } - nvkm_mask(device, 0x61c448 + soff, 0x80000003, 0x80000000 | !!size); - } + for (i = 0; i < size; i++) + nvkm_wr32(device, 0x61c440 + soff, (i << 8) | data[i]); + for (; i < 0x60; i++) + nvkm_wr32(device, 0x61c440 + soff, (i << 8)); + nvkm_mask(device, 0x61c448 + soff, 0x80000002, 0x80000002); +} - return 0; +void +gt215_hda_hpd(struct nvkm_ior *ior, int head, bool present) +{ + struct nvkm_device *device = ior->disp->engine.subdev.device; + u32 data = 0x80000000; + u32 mask = 0x80000001; + if (present) + data |= 0x00000001; + else + mask |= 0x00000002; + nvkm_mask(device, 0x61c448 + ior->id * 0x800, mask, data); } |