Skip to content

Commit 6f8dbcf

Browse files
author
Ben Skeggs
committed
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: Ben Skeggs <[email protected]>
1 parent 0ad679d commit 6f8dbcf

File tree

5 files changed

+18
-10
lines changed

5 files changed

+18
-10
lines changed

drivers/gpu/drm/nouveau/dispnv50/disp.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ nv50_outp_release(struct nouveau_encoder *nv_encoder)
277277
}
278278

279279
static int
280-
nv50_outp_acquire(struct nouveau_encoder *nv_encoder)
280+
nv50_outp_acquire(struct nouveau_encoder *nv_encoder, bool hda)
281281
{
282282
struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev);
283283
struct nv50_disp *disp = nv50_disp(drm->dev);
@@ -289,6 +289,7 @@ nv50_outp_acquire(struct nouveau_encoder *nv_encoder)
289289
.base.method = NV50_DISP_MTHD_V1_ACQUIRE,
290290
.base.hasht = nv_encoder->dcb->hasht,
291291
.base.hashm = nv_encoder->dcb->hashm,
292+
.info.hda = hda,
292293
};
293294
int ret;
294295

@@ -393,7 +394,7 @@ nv50_dac_enable(struct drm_encoder *encoder)
393394
struct nv50_head_atom *asyh = nv50_head_atom(nv_crtc->base.state);
394395
struct nv50_core *core = nv50_disp(encoder->dev)->core;
395396

396-
nv50_outp_acquire(nv_encoder);
397+
nv50_outp_acquire(nv_encoder, false);
397398

398399
core->func->dac->ctrl(core, nv_encoder->or, 1 << nv_crtc->index, asyh);
399400
asyh->or.depth = 0;
@@ -968,7 +969,7 @@ nv50_msto_enable(struct drm_encoder *encoder)
968969
DRM_DEBUG_KMS("Failed to allocate VCPI\n");
969970

970971
if (!mstm->links++)
971-
nv50_outp_acquire(mstm->outp);
972+
nv50_outp_acquire(mstm->outp, false /*XXX: MST audio.*/);
972973

973974
if (mstm->outp->link & 1)
974975
proto = 0x8;
@@ -1562,12 +1563,18 @@ nv50_sor_enable(struct drm_encoder *encoder)
15621563
struct nouveau_drm *drm = nouveau_drm(dev);
15631564
struct nouveau_connector *nv_connector;
15641565
struct nvbios *bios = &drm->vbios;
1566+
bool hda = false;
15651567
u8 proto = 0xf;
15661568
u8 depth = 0x0;
15671569

15681570
nv_connector = nouveau_encoder_connector_get(nv_encoder);
15691571
nv_encoder->crtc = encoder->crtc;
1570-
nv50_outp_acquire(nv_encoder);
1572+
1573+
if ((disp->disp->object.oclass == GT214_DISP ||
1574+
disp->disp->object.oclass >= GF110_DISP) &&
1575+
drm_detect_monitor_audio(nv_connector->edid))
1576+
hda = true;
1577+
nv50_outp_acquire(nv_encoder, hda);
15711578

15721579
switch (nv_encoder->dcb->type) {
15731580
case DCB_OUTPUT_TMDS:
@@ -1777,7 +1784,7 @@ nv50_pior_enable(struct drm_encoder *encoder)
17771784
u8 owner = 1 << nv_crtc->index;
17781785
u8 proto;
17791786

1780-
nv50_outp_acquire(nv_encoder);
1787+
nv50_outp_acquire(nv_encoder, false);
17811788

17821789
switch (asyh->or.bpc) {
17831790
case 10: asyh->or.depth = 0x6; break;

drivers/gpu/drm/nouveau/include/nvif/cl5070.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ struct nv50_disp_acquire_v0 {
4646
__u8 version;
4747
__u8 or;
4848
__u8 link;
49-
__u8 pad03[5];
49+
__u8 hda;
50+
__u8 pad04[4];
5051
};
5152

5253
struct nv50_disp_dac_load_v0 {

drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ nvkm_outp_acquire_ior(struct nvkm_outp *outp, u8 user, struct nvkm_ior *ior)
112112
}
113113

114114
int
115-
nvkm_outp_acquire(struct nvkm_outp *outp, u8 user)
115+
nvkm_outp_acquire(struct nvkm_outp *outp, u8 user, bool hda)
116116
{
117117
struct nvkm_ior *ior = outp->ior;
118118
enum nvkm_ior_proto proto;

drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ int nvkm_outp_new(struct nvkm_disp *, int index, struct dcb_output *,
3232
void nvkm_outp_del(struct nvkm_outp **);
3333
void nvkm_outp_init(struct nvkm_outp *);
3434
void nvkm_outp_fini(struct nvkm_outp *);
35-
int nvkm_outp_acquire(struct nvkm_outp *, u8 user);
35+
int nvkm_outp_acquire(struct nvkm_outp *, u8 user, bool hda);
3636
void nvkm_outp_release(struct nvkm_outp *, u8 user);
3737
void nvkm_outp_route(struct nvkm_disp *);
3838

drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ nv50_disp_root_mthd_(struct nvkm_object *object, u32 mthd, void *data, u32 size)
9999
} *args = data;
100100
int ret = -ENOSYS;
101101
if (!(ret = nvif_unpack(ret, &data, &size, args->v0, 0, 0, false))) {
102-
ret = nvkm_outp_acquire(outp, NVKM_OUTP_USER);
102+
ret = nvkm_outp_acquire(outp, NVKM_OUTP_USER, args->v0.hda);
103103
if (ret == 0) {
104104
args->v0.or = outp->ior->id;
105105
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)
119119
if (!(ret = nvif_unpack(ret, &data, &size, args->v0, 0, 0, false))) {
120120
if (args->v0.data & 0xfff00000)
121121
return -EINVAL;
122-
ret = nvkm_outp_acquire(outp, NVKM_OUTP_PRIV);
122+
ret = nvkm_outp_acquire(outp, NVKM_OUTP_PRIV, false);
123123
if (ret)
124124
return ret;
125125
ret = outp->ior->func->sense(outp->ior, args->v0.data);

0 commit comments

Comments
 (0)