diff options
Diffstat (limited to 'src/rhd_randr.c')
-rw-r--r-- | src/rhd_randr.c | 52 |
1 files changed, 51 insertions, 1 deletions
diff --git a/src/rhd_randr.c b/src/rhd_randr.c index 568c0cd..956119b 100644 --- a/src/rhd_randr.c +++ b/src/rhd_randr.c | |||
@@ -130,11 +130,12 @@ struct rhdRandrCrtc { | |||
130 | #define ATOM_BACKLIGHT "Backlight" | 130 | #define ATOM_BACKLIGHT "Backlight" |
131 | #define ATOM_COHERENT "_Coherent" | 131 | #define ATOM_COHERENT "_Coherent" |
132 | #define ATOM_HDMI "_HDMI" | 132 | #define ATOM_HDMI "_HDMI" |
133 | #define ATOM_AUDIO_WORKAROUND "_AudioStreamSilence" | ||
133 | #define ATOM_ATOMBIOS "_AtomBIOS" | 134 | #define ATOM_ATOMBIOS "_AtomBIOS" |
134 | 135 | ||
135 | static Atom atom_SignalFormat, atom_ConnectorType, atom_ConnectorNumber, | 136 | static Atom atom_SignalFormat, atom_ConnectorType, atom_ConnectorNumber, |
136 | atom_OutputNumber, atom_PanningArea, atom_Backlight, atom_Coherent, | 137 | atom_OutputNumber, atom_PanningArea, atom_Backlight, atom_Coherent, |
137 | atom_HdmiProperty; | 138 | atom_HdmiProperty, atom_AudioWorkaround; |
138 | static Atom atom_unknown, atom_VGA, atom_TMDS, atom_LVDS, atom_DisplayPort, atom_TV; | 139 | static Atom atom_unknown, atom_VGA, atom_TMDS, atom_LVDS, atom_DisplayPort, atom_TV; |
139 | static Atom atom_DVI, atom_DVII, atom_DVID, atom_DVIA, atom_HDMI, atom_Panel; | 140 | static Atom atom_DVI, atom_DVII, atom_DVID, atom_DVIA, atom_HDMI, atom_Panel; |
140 | static Atom atom_EDID, atom_EDID2, atom_AtomBIOS; | 141 | static Atom atom_EDID, atom_EDID2, atom_AtomBIOS; |
@@ -713,6 +714,30 @@ rhdRROutputCreateResources(xf86OutputPtr out) | |||
713 | __func__, err); | 714 | __func__, err); |
714 | } | 715 | } |
715 | } | 716 | } |
717 | if (rout->Output->Property(rout->Output, rhdPropertyCheck, RHD_OUTPUT_AUDIO_WORKAROUND, NULL)) { | ||
718 | atom_AudioWorkaround = MakeAtom(ATOM_AUDIO_WORKAROUND, sizeof(ATOM_AUDIO_WORKAROUND)-1, TRUE); | ||
719 | |||
720 | range[0] = 0; | ||
721 | range[1] = 1; | ||
722 | err = RRConfigureOutputProperty(out->randr_output, atom_AudioWorkaround, | ||
723 | FALSE, TRUE, FALSE, 2, range); | ||
724 | if (err != 0) | ||
725 | xf86DrvMsg(rhdPtr->scrnIndex, X_ERROR, | ||
726 | "RRConfigureOutputProperty error: %d\n", err); | ||
727 | else { | ||
728 | union rhdPropertyData val; | ||
729 | |||
730 | if (!rout->Output->Property(rout->Output, rhdPropertyGet, RHD_OUTPUT_AUDIO_WORKAROUND, &val)) | ||
731 | val.Bool = 1; | ||
732 | err = RRChangeOutputProperty(out->randr_output, atom_AudioWorkaround, | ||
733 | XA_INTEGER, 32, PropModeReplace, | ||
734 | 1, &val.Bool, FALSE, FALSE); | ||
735 | if (err != 0) | ||
736 | xf86DrvMsg(rhdPtr->scrnIndex, X_ERROR, | ||
737 | "In %s RRChangeOutputProperty error: %d\n", | ||
738 | __func__, err); | ||
739 | } | ||
740 | } | ||
716 | 741 | ||
717 | } | 742 | } |
718 | } | 743 | } |
@@ -1408,6 +1433,20 @@ rhdRROutputSetProperty(xf86OutputPtr out, Atom property, | |||
1408 | RHD_OUTPUT_HDMI, NULL); | 1433 | RHD_OUTPUT_HDMI, NULL); |
1409 | } | 1434 | } |
1410 | return FALSE; | 1435 | return FALSE; |
1436 | } else if (property == atom_AudioWorkaround) { | ||
1437 | if (value->type != XA_INTEGER || value->format != 32) { | ||
1438 | xf86DrvMsg(rhdPtr->scrnIndex, X_ERROR, "%s: wrong value\n", __func__); | ||
1439 | return FALSE; | ||
1440 | } | ||
1441 | if (rout->Output->Property) { | ||
1442 | union rhdPropertyData val; | ||
1443 | val.Bool = *(int*)(value->data); | ||
1444 | if(rout->Output->Property(rout->Output, rhdPropertySet, | ||
1445 | RHD_OUTPUT_AUDIO_WORKAROUND, &val)) | ||
1446 | return rout->Output->Property(rout->Output, rhdPropertyCommit, | ||
1447 | RHD_OUTPUT_AUDIO_WORKAROUND, NULL); | ||
1448 | } | ||
1449 | return FALSE; | ||
1411 | #if ENABLE_PROPERTY_ATOMBIOS | 1450 | #if ENABLE_PROPERTY_ATOMBIOS |
1412 | } else if (property == atom_AtomBIOS) { | 1451 | } else if (property == atom_AtomBIOS) { |
1413 | if (value->type != XA_STRING || value->format != 8) | 1452 | if (value->type != XA_STRING || value->format != 8) |
@@ -1585,6 +1624,17 @@ rhdRROutputGetProperty(xf86OutputPtr out, Atom property) | |||
1585 | err = RRChangeOutputProperty(out->randr_output, atom_HdmiProperty, | 1624 | err = RRChangeOutputProperty(out->randr_output, atom_HdmiProperty, |
1586 | XA_INTEGER, 32, PropModeReplace, | 1625 | XA_INTEGER, 32, PropModeReplace, |
1587 | 1, &val.Bool, FALSE, FALSE); | 1626 | 1, &val.Bool, FALSE, FALSE); |
1627 | } else if (property == atom_AudioWorkaround) { | ||
1628 | if (rout->Output->Property == NULL) | ||
1629 | return FALSE; | ||
1630 | |||
1631 | if (!rout->Output->Property(rout->Output, rhdPropertyGet, | ||
1632 | RHD_OUTPUT_AUDIO_WORKAROUND, &val)) | ||
1633 | return FALSE; | ||
1634 | |||
1635 | err = RRChangeOutputProperty(out->randr_output, atom_AudioWorkaround, | ||
1636 | XA_INTEGER, 32, PropModeReplace, | ||
1637 | 1, &val.Bool, FALSE, FALSE); | ||
1588 | } | 1638 | } |
1589 | 1639 | ||
1590 | RHDDebug(rhdPtr->scrnIndex, "%s 0x%x returns %d\n", __func__, property, err); | 1640 | RHDDebug(rhdPtr->scrnIndex, "%s 0x%x returns %d\n", __func__, property, err); |