summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2017-05-19 23:59:35 +1000
committerBen Skeggs <bskeggs@redhat.com>2017-06-16 14:04:56 +1000
commit409b9e54727e700ab8dd15a1e29226eda1e04cdb (patch)
treeeed18b0b3d0549c5b1783575a2f1d2985bb7fb63 /drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c
parent7d1fede03c5880003a08ff080e6e41984902be46 (diff)
downloadblackbird-op-linux-409b9e54727e700ab8dd15a1e29226eda1e04cdb.tar.gz
blackbird-op-linux-409b9e54727e700ab8dd15a1e29226eda1e04cdb.zip
drm/nouveau/disp/gt215-: port HDA ELD controls to nvkm_ior
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c')
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c
index a81928de6dcd..d6371110f5a0 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c
@@ -43,7 +43,6 @@ nv50_disp_root_mthd_(struct nvkm_object *object, u32 mthd, void *data, u32 size)
} *args = data;
struct nv50_disp_root *root = nv50_disp_root(object);
struct nv50_disp *disp = root->disp;
- const struct nv50_disp_func *func = disp->func;
struct nvkm_outp *temp, *outp = NULL;
struct nvkm_head *head;
u16 type, mask = 0;
@@ -112,10 +111,39 @@ nv50_disp_root_mthd_(struct nvkm_object *object, u32 mthd, void *data, u32 size)
return ret;
}
break;
- case NV50_DISP_MTHD_V1_SOR_HDA_ELD:
- if (!func->sor.hda_eld)
+ case NV50_DISP_MTHD_V1_SOR_HDA_ELD: {
+ union {
+ struct nv50_disp_sor_hda_eld_v0 v0;
+ } *args = data;
+ struct nvkm_ior *ior = outp->ior;
+ int ret = -ENOSYS;
+
+ 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;
+
+ if (!ior->func->hda.hpd)
return -ENODEV;
- return func->sor.hda_eld(object, disp, data, size, hidx, outp);
+
+ if (size && args->v0.data[0]) {
+ if (outp->info.type == DCB_OUTPUT_DP)
+ ior->func->dp.audio(ior, hidx, true);
+ ior->func->hda.hpd(ior, hidx, true);
+ ior->func->hda.eld(ior, data, size);
+ } else {
+ if (outp->info.type == DCB_OUTPUT_DP)
+ ior->func->dp.audio(ior, hidx, false);
+ ior->func->hda.hpd(ior, hidx, false);
+ }
+
+ return 0;
+ }
+ break;
case NV50_DISP_MTHD_V1_SOR_HDMI_PWR: {
union {
struct nv50_disp_sor_hdmi_pwr_v0 v0;
OpenPOWER on IntegriCloud