Commit a45f7908 authored by Alastair Bridgewater's avatar Alastair Bridgewater Committed by Ben Skeggs

drm/nouveau/disp/g84-gt200: Use supplied HDMI InfoFrames

Now that we have the InfoFrame data being provided, for the most
part, program the hardware to use it.

While we're here, and since the functionality will come in handy
for supporting 3D stereoscopy, implement setting the Vendor
("generic"?) InfoFrame.

Also don't enable any AVI or Vendor InfoFrame that is not provided,
and disable the Vendor InfoFrame when disabling the output.

Ignore the Audio InfoFrame: We don't supply it, and altering HDMI
audio semantics (for better or worse) on this hardware is out of
scope for me at this time.
Signed-off-by: default avatarAlastair Bridgewater <alastair.bridgewater@gmail.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent f60213c0
...@@ -36,6 +36,8 @@ g84_hdmi_ctrl(NV50_DISP_MTHD_V1) ...@@ -36,6 +36,8 @@ g84_hdmi_ctrl(NV50_DISP_MTHD_V1)
union { union {
struct nv50_disp_sor_hdmi_pwr_v0 v0; struct nv50_disp_sor_hdmi_pwr_v0 v0;
} *args = data; } *args = data;
struct packed_hdmi_infoframe avi_infoframe;
struct packed_hdmi_infoframe vendor_infoframe;
u32 ctrl; u32 ctrl;
int ret = -ENOSYS; int ret = -ENOSYS;
...@@ -61,8 +63,17 @@ g84_hdmi_ctrl(NV50_DISP_MTHD_V1) ...@@ -61,8 +63,17 @@ g84_hdmi_ctrl(NV50_DISP_MTHD_V1)
+ args->v0.vendor_infoframe_length) < size) + args->v0.vendor_infoframe_length) < size)
return -E2BIG; return -E2BIG;
pack_hdmi_infoframe(&avi_infoframe,
data,
args->v0.avi_infoframe_length);
pack_hdmi_infoframe(&vendor_infoframe,
data + args->v0.avi_infoframe_length,
args->v0.vendor_infoframe_length);
if (!(ctrl & 0x40000000)) { if (!(ctrl & 0x40000000)) {
nvkm_mask(device, 0x6165a4 + hoff, 0x40000000, 0x00000000); nvkm_mask(device, 0x6165a4 + hoff, 0x40000000, 0x00000000);
nvkm_mask(device, 0x61653c + hoff, 0x00000001, 0x00000000);
nvkm_mask(device, 0x616520 + hoff, 0x00000001, 0x00000000); nvkm_mask(device, 0x616520 + hoff, 0x00000001, 0x00000000);
nvkm_mask(device, 0x616500 + hoff, 0x00000001, 0x00000000); nvkm_mask(device, 0x616500 + hoff, 0x00000001, 0x00000000);
return 0; return 0;
...@@ -70,12 +81,14 @@ g84_hdmi_ctrl(NV50_DISP_MTHD_V1) ...@@ -70,12 +81,14 @@ g84_hdmi_ctrl(NV50_DISP_MTHD_V1)
/* AVI InfoFrame */ /* AVI InfoFrame */
nvkm_mask(device, 0x616520 + hoff, 0x00000001, 0x00000000); nvkm_mask(device, 0x616520 + hoff, 0x00000001, 0x00000000);
nvkm_wr32(device, 0x616528 + hoff, 0x000d0282); if (args->v0.avi_infoframe_length) {
nvkm_wr32(device, 0x61652c + hoff, 0x0000006f); nvkm_wr32(device, 0x616528 + hoff, avi_infoframe.header);
nvkm_wr32(device, 0x616530 + hoff, 0x00000000); nvkm_wr32(device, 0x61652c + hoff, avi_infoframe.subpack0_low);
nvkm_wr32(device, 0x616534 + hoff, 0x00000000); nvkm_wr32(device, 0x616530 + hoff, avi_infoframe.subpack0_high);
nvkm_wr32(device, 0x616538 + hoff, 0x00000000); nvkm_wr32(device, 0x616534 + hoff, avi_infoframe.subpack1_low);
nvkm_wr32(device, 0x616538 + hoff, avi_infoframe.subpack1_high);
nvkm_mask(device, 0x616520 + hoff, 0x00000001, 0x00000001); nvkm_mask(device, 0x616520 + hoff, 0x00000001, 0x00000001);
}
/* Audio InfoFrame */ /* Audio InfoFrame */
nvkm_mask(device, 0x616500 + hoff, 0x00000001, 0x00000000); nvkm_mask(device, 0x616500 + hoff, 0x00000001, 0x00000000);
...@@ -84,6 +97,18 @@ g84_hdmi_ctrl(NV50_DISP_MTHD_V1) ...@@ -84,6 +97,18 @@ g84_hdmi_ctrl(NV50_DISP_MTHD_V1)
nvkm_wr32(device, 0x616510 + hoff, 0x00000000); nvkm_wr32(device, 0x616510 + hoff, 0x00000000);
nvkm_mask(device, 0x616500 + hoff, 0x00000001, 0x00000001); nvkm_mask(device, 0x616500 + hoff, 0x00000001, 0x00000001);
/* Vendor InfoFrame */
nvkm_mask(device, 0x61653c + hoff, 0x00010001, 0x00010000);
if (args->v0.vendor_infoframe_length) {
nvkm_wr32(device, 0x616544 + hoff, vendor_infoframe.header);
nvkm_wr32(device, 0x616548 + hoff, vendor_infoframe.subpack0_low);
nvkm_wr32(device, 0x61654c + hoff, vendor_infoframe.subpack0_high);
/* Is there a second (or up to fourth?) set of subpack registers here? */
/* nvkm_wr32(device, 0x616550 + hoff, vendor_infoframe->subpack1_low); */
/* nvkm_wr32(device, 0x616554 + hoff, vendor_infoframe->subpack1_high); */
nvkm_mask(device, 0x61653c + hoff, 0x00010001, 0x00010001);
}
nvkm_mask(device, 0x6165d0 + hoff, 0x00070001, 0x00010001); /* SPARE, HW_CTS */ nvkm_mask(device, 0x6165d0 + hoff, 0x00070001, 0x00010001); /* SPARE, HW_CTS */
nvkm_mask(device, 0x616568 + hoff, 0x00010101, 0x00000000); /* ACR_CTRL, ?? */ nvkm_mask(device, 0x616568 + hoff, 0x00010101, 0x00000000); /* ACR_CTRL, ?? */
nvkm_mask(device, 0x616578 + hoff, 0x80000000, 0x80000000); /* ACR_0441_ENABLE */ nvkm_mask(device, 0x616578 + hoff, 0x80000000, 0x80000000); /* ACR_0441_ENABLE */
......
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