Commit 6f8dbcf1 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/disp: provide hint to OR allocation about HDA requirements

Will be used by a subsequent commit to influence SOR allocation policy.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 0ad679d1
...@@ -277,7 +277,7 @@ nv50_outp_release(struct nouveau_encoder *nv_encoder) ...@@ -277,7 +277,7 @@ nv50_outp_release(struct nouveau_encoder *nv_encoder)
} }
static int static int
nv50_outp_acquire(struct nouveau_encoder *nv_encoder) nv50_outp_acquire(struct nouveau_encoder *nv_encoder, bool hda)
{ {
struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev); struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev);
struct nv50_disp *disp = nv50_disp(drm->dev); struct nv50_disp *disp = nv50_disp(drm->dev);
...@@ -289,6 +289,7 @@ nv50_outp_acquire(struct nouveau_encoder *nv_encoder) ...@@ -289,6 +289,7 @@ nv50_outp_acquire(struct nouveau_encoder *nv_encoder)
.base.method = NV50_DISP_MTHD_V1_ACQUIRE, .base.method = NV50_DISP_MTHD_V1_ACQUIRE,
.base.hasht = nv_encoder->dcb->hasht, .base.hasht = nv_encoder->dcb->hasht,
.base.hashm = nv_encoder->dcb->hashm, .base.hashm = nv_encoder->dcb->hashm,
.info.hda = hda,
}; };
int ret; int ret;
...@@ -393,7 +394,7 @@ nv50_dac_enable(struct drm_encoder *encoder) ...@@ -393,7 +394,7 @@ nv50_dac_enable(struct drm_encoder *encoder)
struct nv50_head_atom *asyh = nv50_head_atom(nv_crtc->base.state); struct nv50_head_atom *asyh = nv50_head_atom(nv_crtc->base.state);
struct nv50_core *core = nv50_disp(encoder->dev)->core; struct nv50_core *core = nv50_disp(encoder->dev)->core;
nv50_outp_acquire(nv_encoder); nv50_outp_acquire(nv_encoder, false);
core->func->dac->ctrl(core, nv_encoder->or, 1 << nv_crtc->index, asyh); core->func->dac->ctrl(core, nv_encoder->or, 1 << nv_crtc->index, asyh);
asyh->or.depth = 0; asyh->or.depth = 0;
...@@ -968,7 +969,7 @@ nv50_msto_enable(struct drm_encoder *encoder) ...@@ -968,7 +969,7 @@ nv50_msto_enable(struct drm_encoder *encoder)
DRM_DEBUG_KMS("Failed to allocate VCPI\n"); DRM_DEBUG_KMS("Failed to allocate VCPI\n");
if (!mstm->links++) if (!mstm->links++)
nv50_outp_acquire(mstm->outp); nv50_outp_acquire(mstm->outp, false /*XXX: MST audio.*/);
if (mstm->outp->link & 1) if (mstm->outp->link & 1)
proto = 0x8; proto = 0x8;
...@@ -1562,12 +1563,18 @@ nv50_sor_enable(struct drm_encoder *encoder) ...@@ -1562,12 +1563,18 @@ nv50_sor_enable(struct drm_encoder *encoder)
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_connector *nv_connector; struct nouveau_connector *nv_connector;
struct nvbios *bios = &drm->vbios; struct nvbios *bios = &drm->vbios;
bool hda = false;
u8 proto = 0xf; u8 proto = 0xf;
u8 depth = 0x0; u8 depth = 0x0;
nv_connector = nouveau_encoder_connector_get(nv_encoder); nv_connector = nouveau_encoder_connector_get(nv_encoder);
nv_encoder->crtc = encoder->crtc; nv_encoder->crtc = encoder->crtc;
nv50_outp_acquire(nv_encoder);
if ((disp->disp->object.oclass == GT214_DISP ||
disp->disp->object.oclass >= GF110_DISP) &&
drm_detect_monitor_audio(nv_connector->edid))
hda = true;
nv50_outp_acquire(nv_encoder, hda);
switch (nv_encoder->dcb->type) { switch (nv_encoder->dcb->type) {
case DCB_OUTPUT_TMDS: case DCB_OUTPUT_TMDS:
...@@ -1777,7 +1784,7 @@ nv50_pior_enable(struct drm_encoder *encoder) ...@@ -1777,7 +1784,7 @@ nv50_pior_enable(struct drm_encoder *encoder)
u8 owner = 1 << nv_crtc->index; u8 owner = 1 << nv_crtc->index;
u8 proto; u8 proto;
nv50_outp_acquire(nv_encoder); nv50_outp_acquire(nv_encoder, false);
switch (asyh->or.bpc) { switch (asyh->or.bpc) {
case 10: asyh->or.depth = 0x6; break; case 10: asyh->or.depth = 0x6; break;
......
...@@ -46,7 +46,8 @@ struct nv50_disp_acquire_v0 { ...@@ -46,7 +46,8 @@ struct nv50_disp_acquire_v0 {
__u8 version; __u8 version;
__u8 or; __u8 or;
__u8 link; __u8 link;
__u8 pad03[5]; __u8 hda;
__u8 pad04[4];
}; };
struct nv50_disp_dac_load_v0 { struct nv50_disp_dac_load_v0 {
......
...@@ -112,7 +112,7 @@ nvkm_outp_acquire_ior(struct nvkm_outp *outp, u8 user, struct nvkm_ior *ior) ...@@ -112,7 +112,7 @@ nvkm_outp_acquire_ior(struct nvkm_outp *outp, u8 user, struct nvkm_ior *ior)
} }
int int
nvkm_outp_acquire(struct nvkm_outp *outp, u8 user) nvkm_outp_acquire(struct nvkm_outp *outp, u8 user, bool hda)
{ {
struct nvkm_ior *ior = outp->ior; struct nvkm_ior *ior = outp->ior;
enum nvkm_ior_proto proto; enum nvkm_ior_proto proto;
......
...@@ -32,7 +32,7 @@ int nvkm_outp_new(struct nvkm_disp *, int index, struct dcb_output *, ...@@ -32,7 +32,7 @@ int nvkm_outp_new(struct nvkm_disp *, int index, struct dcb_output *,
void nvkm_outp_del(struct nvkm_outp **); void nvkm_outp_del(struct nvkm_outp **);
void nvkm_outp_init(struct nvkm_outp *); void nvkm_outp_init(struct nvkm_outp *);
void nvkm_outp_fini(struct nvkm_outp *); void nvkm_outp_fini(struct nvkm_outp *);
int nvkm_outp_acquire(struct nvkm_outp *, u8 user); int nvkm_outp_acquire(struct nvkm_outp *, u8 user, bool hda);
void nvkm_outp_release(struct nvkm_outp *, u8 user); void nvkm_outp_release(struct nvkm_outp *, u8 user);
void nvkm_outp_route(struct nvkm_disp *); void nvkm_outp_route(struct nvkm_disp *);
......
...@@ -99,7 +99,7 @@ nv50_disp_root_mthd_(struct nvkm_object *object, u32 mthd, void *data, u32 size) ...@@ -99,7 +99,7 @@ nv50_disp_root_mthd_(struct nvkm_object *object, u32 mthd, void *data, u32 size)
} *args = data; } *args = data;
int ret = -ENOSYS; int ret = -ENOSYS;
if (!(ret = nvif_unpack(ret, &data, &size, args->v0, 0, 0, false))) { if (!(ret = nvif_unpack(ret, &data, &size, args->v0, 0, 0, false))) {
ret = nvkm_outp_acquire(outp, NVKM_OUTP_USER); ret = nvkm_outp_acquire(outp, NVKM_OUTP_USER, args->v0.hda);
if (ret == 0) { if (ret == 0) {
args->v0.or = outp->ior->id; args->v0.or = outp->ior->id;
args->v0.link = outp->ior->asy.link; args->v0.link = outp->ior->asy.link;
...@@ -119,7 +119,7 @@ nv50_disp_root_mthd_(struct nvkm_object *object, u32 mthd, void *data, u32 size) ...@@ -119,7 +119,7 @@ nv50_disp_root_mthd_(struct nvkm_object *object, u32 mthd, void *data, u32 size)
if (!(ret = nvif_unpack(ret, &data, &size, args->v0, 0, 0, false))) { if (!(ret = nvif_unpack(ret, &data, &size, args->v0, 0, 0, false))) {
if (args->v0.data & 0xfff00000) if (args->v0.data & 0xfff00000)
return -EINVAL; return -EINVAL;
ret = nvkm_outp_acquire(outp, NVKM_OUTP_PRIV); ret = nvkm_outp_acquire(outp, NVKM_OUTP_PRIV, false);
if (ret) if (ret)
return ret; return ret;
ret = outp->ior->func->sense(outp->ior, args->v0.data); ret = outp->ior->func->sense(outp->ior, args->v0.data);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment