Skip to contentSkip to conversation

radeon_connector->audio is set by RADEON_AUDIO_DISABLE as default.

PATCH Hyungwon Hwang 2 participants 5 messages Apr 13, 2016 – Apr 14, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Dear all,

I switched my desktop environment to GNOME wayland recently, and I found that no sound in this environment. In X desktop environment, the ioctl DRM_IOCTL_MODE_SETPROPERTY(I confused it with DRM_IOCTL_MODE_OBJ_SETPROPERTY - I deleted the log already :( ) is called by userspace and it makes the sound works. But in Gnome wayland desktop environment, the ioctl is not called. I tried to fixed it, and found that it is because radeon_connector->audio is set by RADEON_AUDIO_DISABLE.

In atombios_encoders.c, atombios_get_encoder_mode() if (radeon_connector->audio == RADEON_AUDIO_ENABLE)

        return ATOM_ENCODER_MODE_HDMI;
else if (drm_detect_hdmi_monitor(radeon_connector_edid(connector)) &&
         (radeon_connector->audio == RADEON_AUDIO_AUTO))
        return ATOM_ENCODER_MODE_HDMI;
else
        return ATOM_ENCODER_MODE_DVI;

This code returns ATOM_ENCODER_MODE_DVI.

In atombios_encoders.c, radeon_atom_encoder_mode_set():
encoder_mode = atombios_get_encoder_mode(encoder);

if (connector && (radeon_audio != 0) &&

    ((encoder_mode == ATOM_ENCODER_MODE_HDMI) ||

     ENCODER_MODE_IS_DP(encoder_mode)))

        radeon_audio_mode_set(encoder, adjusted_mode);b

So this code bypasses the calling of radeon_audio_mode_set().

I think that radeon_connector->audio should be set by RADEON_AUDIO_AUTO, at least for connectors which can output audio. I fixed the code like below, and it works for me. But I am not familiar with radeon DRM driver, and can't see the big picture. Can you review this code?

Thanks,
Hyungwon Hwang

(quoted diff) +0 -0

b/drivers/gpu/drm/radeon/radeon_connectors.c
index cfcc099..cf52ea5 100644

drivers/gpu/drm/radeon/radeon_connectors.c +0 -0
@@ -1975,11 +1975,12 @@ radeon_add_atom_connector(struct drm_device *dev,
 

rdev->mode_info.output_csc_property,

RADEON_OUTPUT_CSC_BYPASS);
                        break;

- case DRM_MODE_CONNECTOR_DVII:
- case DRM_MODE_CONNECTOR_DVID:
case DRM_MODE_CONNECTOR_HDMIA:
case DRM_MODE_CONNECTOR_HDMIB:
case DRM_MODE_CONNECTOR_DisplayPort:
+ radeon_connector->audio = RADEON_AUDIO_AUTO;
+ case DRM_MODE_CONNECTOR_DVII:
+ case DRM_MODE_CONNECTOR_DVID:

                        drm_connector_init(dev, &radeon_connector->base,
                                           &radeon_dp_connector_funcs,
connector_type);
                        drm_connector_helper_add(&radeon_connector->base,
@@ -2024,8 +2025,9 @@ radeon_add_atom_connector(struct drm_device *dev,
                                                              1);
                        }
                        break;

- case DRM_MODE_CONNECTOR_LVDS:
case DRM_MODE_CONNECTOR_eDP:
+ radeon_connector->audio = RADEON_AUDIO_AUTO;
+ case DRM_MODE_CONNECTOR_LVDS:

                        drm_connector_init(dev, &radeon_connector->base,
&radeon_lvds_bridge_connector_funcs, connector_type);
                        drm_connector_helper_add(&radeon_connector->base,
@@ -2196,6 +2198,7 @@ radeon_add_atom_connector(struct drm_device *dev,
                                connector->doublescan_allowed = true;
                        else
                                connector->doublescan_allowed = false;

+ radeon_connector->audio = RADEON_AUDIO_AUTO;
break;
case DRM_MODE_CONNECTOR_DisplayPort:
radeon_dig_connector = kzalloc(sizeof(struct
radeon_connector_atom_dig), GFP_KERNEL);
@@ -2245,6 +2248,7 @@ radeon_add_atom_connector(struct drm_device *dev,

                        connector->interlace_allowed = true;
                        /* in theory with a DP to VGA converter... */
                        connector->doublescan_allowed = false;

+ radeon_connector->audio = RADEON_AUDIO_AUTO;
break;
case DRM_MODE_CONNECTOR_eDP:
radeon_dig_connector = kzalloc(sizeof(struct
radeon_connector_atom_dig), GFP_KERNEL);
@@ -2267,6 +2271,7 @@ radeon_add_atom_connector(struct drm_device *dev,

                        subpixel_order = SubPixelHorizontalRGB;
                        connector->interlace_allowed = false;
                        connector->doublescan_allowed = false;
+                       radeon_connector->audio = RADEON_AUDIO_AUTO;
                        break;
                case DRM_MODE_CONNECTOR_SVIDEO:
                case DRM_MODE_CONNECTOR_Composite:

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw
Quoted 9 lines

-----Original Message-----
From: Hyungwon Hwang [mailto:[email protected]]
Sent: Wednesday, April 13, 2016 11:55 AM
To: Deucher, Alexander; Koenig, Christian; [email protected]
Subject: radeon_connector->audio is set by RADEON_AUDIO_DISABLE as default.

Dear all,

Quoted 9 lines

I switched my desktop environment to GNOME wayland recently, and I found
that no sound in this environment. In X desktop environment, the ioctl DRM_IOCTL_MODE_SETPROPERTY(I confused it with DRM_IOCTL_MODE_OBJ_SETPROPERTY - I deleted the log already :( ) is called by userspace and it makes the sound works. But in Gnome wayland desktop environment, the ioctl is not called. I tried to fixed it, and found that it is because radeon_connector->audio is set by RADEON_AUDIO_DISABLE.

Thanks for spotting this. Does the attached patch fix it?

Alex

Quoted 99 lines

In atombios_encoders.c, atombios_get_encoder_mode() if (radeon_connector->audio == RADEON_AUDIO_ENABLE)

        return ATOM_ENCODER_MODE_HDMI;
else if (drm_detect_hdmi_monitor(radeon_connector_edid(connector)) &&
         (radeon_connector->audio == RADEON_AUDIO_AUTO))
        return ATOM_ENCODER_MODE_HDMI;
else
        return ATOM_ENCODER_MODE_DVI;

This code returns ATOM_ENCODER_MODE_DVI.

In atombios_encoders.c, radeon_atom_encoder_mode_set():
encoder_mode = atombios_get_encoder_mode(encoder);

if (connector && (radeon_audio != 0) &&

    ((encoder_mode == ATOM_ENCODER_MODE_HDMI) ||

     ENCODER_MODE_IS_DP(encoder_mode)))

        radeon_audio_mode_set(encoder, adjusted_mode);b

So this code bypasses the calling of radeon_audio_mode_set().

I think that radeon_connector->audio should be set by RADEON_AUDIO_AUTO, at least for connectors which can output audio. I fixed the code like below, and it works for me. But I am not familiar with radeon DRM driver, and can't see the big picture. Can you review this code?

Thanks,
Hyungwon Hwang

drivers/gpu/drm/radeon/radeon_connectors.c +3 -2
index cfcc099..cf52ea5 100644
@@ -1975,11 +1975,12 @@ radeon_add_atom_connector(struct drm_device
 *dev,
 
 rdev->mode_info.output_csc_property,
 
 RADEON_OUTPUT_CSC_BYPASS);
                        break;
-               case DRM_MODE_CONNECTOR_DVII:
-               case DRM_MODE_CONNECTOR_DVID:
                case DRM_MODE_CONNECTOR_HDMIA:
                case DRM_MODE_CONNECTOR_HDMIB:
                case DRM_MODE_CONNECTOR_DisplayPort:
+                       radeon_connector->audio = RADEON_AUDIO_AUTO;
+               case DRM_MODE_CONNECTOR_DVII:
+               case DRM_MODE_CONNECTOR_DVID:
                        drm_connector_init(dev, &radeon_connector->base,
                                           &radeon_dp_connector_funcs,
connector_type);
                        drm_connector_helper_add(&radeon_connector->base,
drivers/gpu/drm/radeon/radeon_connectors.c +2 -1
@@ -2024,8 +2025,9 @@ radeon_add_atom_connector(struct drm_device
 *dev,
                                                              1);
                        }
                        break;
-               case DRM_MODE_CONNECTOR_LVDS:
                case DRM_MODE_CONNECTOR_eDP:
+                       radeon_connector->audio = RADEON_AUDIO_AUTO;
+               case DRM_MODE_CONNECTOR_LVDS:
                        drm_connector_init(dev, &radeon_connector->base,
 
&radeon_lvds_bridge_connector_funcs, connector_type);
                        drm_connector_helper_add(&radeon_connector->base,
drivers/gpu/drm/radeon/radeon_connectors.c +1 -0
@@ -2196,6 +2198,7 @@ radeon_add_atom_connector(struct drm_device
 *dev,
                                connector->doublescan_allowed = true;
                        else
                                connector->doublescan_allowed = false;
+                       radeon_connector->audio = RADEON_AUDIO_AUTO;
                        break;
                case DRM_MODE_CONNECTOR_DisplayPort:

radeon_dig_connector = kzalloc(sizeof(struct
radeon_connector_atom_dig), GFP_KERNEL);

drivers/gpu/drm/radeon/radeon_connectors.c +1 -0
@@ -2245,6 +2248,7 @@ radeon_add_atom_connector(struct drm_device
 *dev,
                        connector->interlace_allowed = true;
                        /* in theory with a DP to VGA converter... */
                        connector->doublescan_allowed = false;
+                       radeon_connector->audio = RADEON_AUDIO_AUTO;
                        break;
                case DRM_MODE_CONNECTOR_eDP:

radeon_dig_connector = kzalloc(sizeof(struct
radeon_connector_atom_dig), GFP_KERNEL);

drivers/gpu/drm/radeon/radeon_connectors.c +1 -0
@@ -2267,6 +2271,7 @@ radeon_add_atom_connector(struct drm_device
 *dev,
                        subpixel_order = SubPixelHorizontalRGB;
                        connector->interlace_allowed = false;
                        connector->doublescan_allowed = false;
+                       radeon_connector->audio = RADEON_AUDIO_AUTO;
                        break;
                case DRM_MODE_CONNECTOR_SVIDEO:
Quoted 1 line

case DRM_MODE_CONNECTOR_Composite:

From 725c49e8f05f6f5daa91099ccb84ce01881bdb95 Mon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Wed, 13 Apr 2016 12:08:27 -0400
Subject: [PATCH] drm/radeon: fix initial connector audio value

This got lost somewhere along the way. This fixes audio not working until set_property was called.

---
 drivers/gpu/drm/radeon/radeon_connectors.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_connectors.c +6 -1
index cfcc099..81a63d7 100644
@@ -2002,10 +2002,12 @@ radeon_add_atom_connector(struct drm_device *dev,
 						   rdev->mode_info.dither_property,
 						   RADEON_FMT_DITHER_DISABLE);
 
-			if (radeon_audio != 0)
+			if (radeon_audio != 0) {
 				drm_object_attach_property(&radeon_connector->base.base,
 							   rdev->mode_info.audio_property,
 							   RADEON_AUDIO_AUTO);
+				radeon_connector->audio = RADEON_AUDIO_AUTO;
+			}
 			if (ASIC_IS_DCE5(rdev))
 				drm_object_attach_property(&radeon_connector->base.base,
 							   rdev->mode_info.output_csc_property,
@@ -2130,6 +2132,7 @@ radeon_add_atom_connector(struct drm_device *dev,
 				drm_object_attach_property(&radeon_connector->base.base,
 							   rdev->mode_info.audio_property,
 							   RADEON_AUDIO_AUTO);
+				radeon_connector->audio = RADEON_AUDIO_AUTO;
 			}
 			if (connector_type == DRM_MODE_CONNECTOR_DVII) {
 				radeon_connector->dac_load_detect = true;
@@ -2185,6 +2188,7 @@ radeon_add_atom_connector(struct drm_device *dev,
 				drm_object_attach_property(&radeon_connector->base.base,
 							   rdev->mode_info.audio_property,
 							   RADEON_AUDIO_AUTO);
+				radeon_connector->audio = RADEON_AUDIO_AUTO;
 			}
 			if (ASIC_IS_DCE5(rdev))
 				drm_object_attach_property(&radeon_connector->base.base,
@@ -2237,6 +2241,7 @@ radeon_add_atom_connector(struct drm_device *dev,
 				drm_object_attach_property(&radeon_connector->base.base,
 							   rdev->mode_info.audio_property,
 							   RADEON_AUDIO_AUTO);
+				radeon_connector->audio = RADEON_AUDIO_AUTO;
 			}
 			if (ASIC_IS_DCE5(rdev))
 				drm_object_attach_property(&radeon_connector->base.base,
Signature · 1 line
2.5.5

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw

2016. 4. 14. 오전 1:12에 "Deucher, Alexander" <[email protected]>님이 작성:

Quoted 5 lines
Quoted 5 lines

-----Original Message-----
From: Hyungwon Hwang [mailto:[email protected]]
Sent: Wednesday, April 13, 2016 11:55 AM
To: Deucher, Alexander; Koenig, Christian;

[email protected]

Quoted 15 lines
Quoted 5 lines

Subject: radeon_connector->audio is set by RADEON_AUDIO_DISABLE as default.

Dear all,

Quoted 9 lines

I switched my desktop environment to GNOME wayland recently, and I found
that no sound in this environment. In X desktop environment, the ioctl DRM_IOCTL_MODE_SETPROPERTY(I confused it with DRM_IOCTL_MODE_OBJ_SETPROPERTY - I deleted the log already :( ) is called by userspace and it makes the sound works. But in Gnome wayland desktop environment, the ioctl is not called. I tried to fixed it, and found that it is because radeon_connector->audio is set by RADEON_AUDIO_DISABLE.

Quoted 3 lines

Thanks for spotting this. Does the attached patch fix it?

Alex

Yes. But I could test it only in my environment (radeon hd 5700 + hdmi monitor).

Thanks,
Hyungwon Hwang

Quoted 45 lines
Quoted 45 lines

In atombios_encoders.c, atombios_get_encoder_mode() if (radeon_connector->audio == RADEON_AUDIO_ENABLE)

        return ATOM_ENCODER_MODE_HDMI;
else if (drm_detect_hdmi_monitor(radeon_connector_edid(connector)) &&
         (radeon_connector->audio == RADEON_AUDIO_AUTO))
        return ATOM_ENCODER_MODE_HDMI;
else
        return ATOM_ENCODER_MODE_DVI;

This code returns ATOM_ENCODER_MODE_DVI.

In atombios_encoders.c, radeon_atom_encoder_mode_set():
encoder_mode = atombios_get_encoder_mode(encoder);

if (connector && (radeon_audio != 0) &&

    ((encoder_mode == ATOM_ENCODER_MODE_HDMI) ||

     ENCODER_MODE_IS_DP(encoder_mode)))

        radeon_audio_mode_set(encoder, adjusted_mode);b

So this code bypasses the calling of radeon_audio_mode_set().

I think that radeon_connector->audio should be set by RADEON_AUDIO_AUTO, at least for connectors which can output audio. I fixed the code like below, and it works for me. But I am not familiar with radeon DRM driver, and can't see the big picture. Can you review this code?

Thanks,
Hyungwon Hwang

drivers/gpu/drm/radeon/radeon_connectors.c +0 -0
index cfcc099..cf52ea5 100644
@@ -1975,11 +1975,12 @@ radeon_add_atom_connector(struct drm_device
 *dev,
 
 rdev->mode_info.output_csc_property,
 
Quoted 14 lines
Quoted 12 lines
drivers/gpu/drm/radeon/radeon_connectors.c +3 -2
 RADEON_OUTPUT_CSC_BYPASS);
                        break;
-               case DRM_MODE_CONNECTOR_DVII:
-               case DRM_MODE_CONNECTOR_DVID:
                case DRM_MODE_CONNECTOR_HDMIA:
                case DRM_MODE_CONNECTOR_HDMIB:
                case DRM_MODE_CONNECTOR_DisplayPort:
+                       radeon_connector->audio = RADEON_AUDIO_AUTO;
+               case DRM_MODE_CONNECTOR_DVII:
+               case DRM_MODE_CONNECTOR_DVID:
                        drm_connector_init(dev, &radeon_connector->base,
                                           &radeon_dp_connector_funcs,
Quoted 2 lines

connector_type);

drm_connector_helper_add(&radeon_connector->base,

Quoted 11 lines
Quoted 11 lines
drivers/gpu/drm/radeon/radeon_connectors.c +2 -1
@@ -2024,8 +2025,9 @@ radeon_add_atom_connector(struct drm_device
 *dev,
                                                              1);
                        }
                        break;
-               case DRM_MODE_CONNECTOR_LVDS:
                case DRM_MODE_CONNECTOR_eDP:
+                       radeon_connector->audio = RADEON_AUDIO_AUTO;
+               case DRM_MODE_CONNECTOR_LVDS:
                        drm_connector_init(dev, &radeon_connector->base,
 
Quoted 2 lines
Quoted 2 lines

&radeon_lvds_bridge_connector_funcs, connector_type);

drm_connector_helper_add(&radeon_connector->base,

Quoted 21 lines
Quoted 21 lines
drivers/gpu/drm/radeon/radeon_connectors.c +1 -0
@@ -2196,6 +2198,7 @@ radeon_add_atom_connector(struct drm_device
 *dev,
                                connector->doublescan_allowed = true;
                        else
                                connector->doublescan_allowed = false;
+                       radeon_connector->audio = RADEON_AUDIO_AUTO;
                        break;
                case DRM_MODE_CONNECTOR_DisplayPort:

radeon_dig_connector = kzalloc(sizeof(struct
radeon_connector_atom_dig), GFP_KERNEL);

drivers/gpu/drm/radeon/radeon_connectors.c +1 -0
@@ -2245,6 +2248,7 @@ radeon_add_atom_connector(struct drm_device
 *dev,
                        connector->interlace_allowed = true;
                        /* in theory with a DP to VGA converter... */
                        connector->doublescan_allowed = false;
+                       radeon_connector->audio = RADEON_AUDIO_AUTO;
                        break;
                case DRM_MODE_CONNECTOR_eDP:

radeon_dig_connector = kzalloc(sizeof(struct
radeon_connector_atom_dig), GFP_KERNEL);

drivers/gpu/drm/radeon/radeon_connectors.c +0 -0
@@ -2267,6 +2271,7 @@ radeon_add_atom_connector(struct drm_device
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/radeon/radeon_connectors.c +1 -0
 *dev,
                        subpixel_order = SubPixelHorizontalRGB;
                        connector->interlace_allowed = false;
                        connector->doublescan_allowed = false;
+                       radeon_connector->audio = RADEON_AUDIO_AUTO;
                        break;
                case DRM_MODE_CONNECTOR_SVIDEO:

case DRM_MODE_CONNECTOR_Composite:

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

2016. 4. 14. 오전 11:59에 "Hyungwon Hwang" <[email protected]>님이 작성:

Quoted 3 lines

2016. 4. 14. 오전 1:12에 "Deucher, Alexander" <[email protected]>님이

작성:

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

-----Original Message-----
From: Hyungwon Hwang [mailto:[email protected]]
Sent: Wednesday, April 13, 2016 11:55 AM
To: Deucher, Alexander; Koenig, Christian;

[email protected]

Quoted 15 lines
Quoted 15 lines
Quoted 14 lines

Subject: radeon_connector->audio is set by RADEON_AUDIO_DISABLE as default.

Dear all,

I switched my desktop environment to GNOME wayland recently, and I found
that no sound in this environment. In X desktop environment, the ioctl DRM_IOCTL_MODE_SETPROPERTY(I confused it with DRM_IOCTL_MODE_OBJ_SETPROPERTY - I deleted the log already :( ) is called by userspace and it makes the sound works. But in Gnome wayland desktop environment, the ioctl is not called. I tried to fixed it, and found that it is because radeon_connector->audio is set by RADEON_AUDIO_DISABLE.

Quoted 5 lines
Quoted 3 lines

Thanks for spotting this. Does the attached patch fix it?

Alex

Yes. But I could test it only in my environment (radeon hd 5700 + hdmi

monitor).

Quoted 3 lines

Thanks,
Hyungwon Hwang

Oh. Sorry. I couldn't see that there was an attached patch, becaue I checked it in mailing archive. I can test it at night. After that, I will send the reply again.

Thanks,
Hyungwon Hwang

Quoted 46 lines
Quoted 46 lines
Quoted 46 lines

In atombios_encoders.c, atombios_get_encoder_mode() if (radeon_connector->audio == RADEON_AUDIO_ENABLE)

        return ATOM_ENCODER_MODE_HDMI;
else if (drm_detect_hdmi_monitor(radeon_connector_edid(connector)) &&
         (radeon_connector->audio == RADEON_AUDIO_AUTO))
        return ATOM_ENCODER_MODE_HDMI;
else
        return ATOM_ENCODER_MODE_DVI;

This code returns ATOM_ENCODER_MODE_DVI.

In atombios_encoders.c, radeon_atom_encoder_mode_set():
encoder_mode = atombios_get_encoder_mode(encoder);

if (connector && (radeon_audio != 0) &&

    ((encoder_mode == ATOM_ENCODER_MODE_HDMI) ||

     ENCODER_MODE_IS_DP(encoder_mode)))

        radeon_audio_mode_set(encoder, adjusted_mode);b

So this code bypasses the calling of radeon_audio_mode_set().

I think that radeon_connector->audio should be set by RADEON_AUDIO_AUTO, at least for connectors which can output audio. I fixed the code like below, and it works for me. But I am not familiar with radeon DRM driver, and can't see the big picture. Can you review this code?

Thanks,
Hyungwon Hwang

drivers/gpu/drm/radeon/radeon_connectors.c +0 -0
index cfcc099..cf52ea5 100644
@@ -1975,11 +1975,12 @@ radeon_add_atom_connector(struct drm_device
 *dev,
 
 rdev->mode_info.output_csc_property,
 
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
drivers/gpu/drm/radeon/radeon_connectors.c +3 -2
 RADEON_OUTPUT_CSC_BYPASS);
                        break;
-               case DRM_MODE_CONNECTOR_DVII:
-               case DRM_MODE_CONNECTOR_DVID:
                case DRM_MODE_CONNECTOR_HDMIA:
                case DRM_MODE_CONNECTOR_HDMIB:
                case DRM_MODE_CONNECTOR_DisplayPort:
+                       radeon_connector->audio = RADEON_AUDIO_AUTO;
+               case DRM_MODE_CONNECTOR_DVII:
+               case DRM_MODE_CONNECTOR_DVID:

drm_connector_init(dev,

&radeon_connector->base,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

&radeon_dp_connector_funcs,
connector_type);

drm_connector_helper_add(&radeon_connector->base,

Quoted 10 lines
Quoted 10 lines

drivers/gpu/drm/radeon/radeon_connectors.c radeon_add_atom_connector(struct drm_device · line 2032

Quoted 10 lines
drivers/gpu/drm/radeon/radeon_connectors.c +2 -1
@@ -2024,8 +2025,9 @@ radeon_add_atom_connector(struct drm_device
 *dev,
                                                              1);
                        }
                        break;
-               case DRM_MODE_CONNECTOR_LVDS:
                case DRM_MODE_CONNECTOR_eDP:
+                       radeon_connector->audio = RADEON_AUDIO_AUTO;
+               case DRM_MODE_CONNECTOR_LVDS:
                        drm_connector_init(dev,

&radeon_connector->base,

Quoted 3 lines
Quoted 3 lines

drivers/gpu/drm/radeon/radeon_connectors.c radeon_add_atom_connector(struct drm_device · line 2033

Quoted 3 lines
drivers/gpu/drm/radeon/radeon_connectors.c +0 -0
 &radeon_lvds_bridge_connector_funcs, connector_type);

drm_connector_helper_add(&radeon_connector->base,

Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
drivers/gpu/drm/radeon/radeon_connectors.c +1 -0
@@ -2196,6 +2198,7 @@ radeon_add_atom_connector(struct drm_device
 *dev,
                                connector->doublescan_allowed = true;
                        else
                                connector->doublescan_allowed = false;
+                       radeon_connector->audio = RADEON_AUDIO_AUTO;
                        break;
                case DRM_MODE_CONNECTOR_DisplayPort:

radeon_dig_connector = kzalloc(sizeof(struct
radeon_connector_atom_dig), GFP_KERNEL);

drivers/gpu/drm/radeon/radeon_connectors.c +1 -0
@@ -2245,6 +2248,7 @@ radeon_add_atom_connector(struct drm_device
 *dev,
                        connector->interlace_allowed = true;
                        /* in theory with a DP to VGA converter... */
                        connector->doublescan_allowed = false;
+                       radeon_connector->audio = RADEON_AUDIO_AUTO;
                        break;
                case DRM_MODE_CONNECTOR_eDP:

radeon_dig_connector = kzalloc(sizeof(struct
radeon_connector_atom_dig), GFP_KERNEL);

drivers/gpu/drm/radeon/radeon_connectors.c +0 -0
@@ -2267,6 +2271,7 @@ radeon_add_atom_connector(struct drm_device
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/radeon/radeon_connectors.c +1 -0
 *dev,
                        subpixel_order = SubPixelHorizontalRGB;
                        connector->interlace_allowed = false;
                        connector->doublescan_allowed = false;
+                       radeon_connector->audio = RADEON_AUDIO_AUTO;
                        break;
                case DRM_MODE_CONNECTOR_SVIDEO:

case DRM_MODE_CONNECTOR_Composite:

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw
In reply to Deucher, Alexander

2016년 04월 14일 01:12에 Deucher, Alexander 이(가) 쓴 글:

Quoted 19 lines
Quoted 9 lines

-----Original Message-----
From: Hyungwon Hwang [mailto:[email protected]]
Sent: Wednesday, April 13, 2016 11:55 AM
To: Deucher, Alexander; Koenig, Christian; [email protected]
Subject: radeon_connector->audio is set by RADEON_AUDIO_DISABLE as default.

Dear all,

Quoted 9 lines

I switched my desktop environment to GNOME wayland recently, and I found
that no sound in this environment. In X desktop environment, the ioctl DRM_IOCTL_MODE_SETPROPERTY(I confused it with DRM_IOCTL_MODE_OBJ_SETPROPERTY - I deleted the log already :( ) is called by userspace and it makes the sound works. But in Gnome wayland desktop environment, the ioctl is not called. I tried to fixed it, and found that it is because radeon_connector->audio is set by RADEON_AUDIO_DISABLE.

Quoted 3 lines

Thanks for spotting this. Does the attached patch fix it?

Alex

Great. Now it works with your patch. Thanks for your work.

Best regards,
Hyungwon Hwang

Quoted 93 lines
Quoted 93 lines

In atombios_encoders.c, atombios_get_encoder_mode() if (radeon_connector->audio == RADEON_AUDIO_ENABLE)

        return ATOM_ENCODER_MODE_HDMI;
else if (drm_detect_hdmi_monitor(radeon_connector_edid(connector)) &&
         (radeon_connector->audio == RADEON_AUDIO_AUTO))
        return ATOM_ENCODER_MODE_HDMI;
else
        return ATOM_ENCODER_MODE_DVI;

This code returns ATOM_ENCODER_MODE_DVI.

In atombios_encoders.c, radeon_atom_encoder_mode_set():
encoder_mode = atombios_get_encoder_mode(encoder);

if (connector && (radeon_audio != 0) &&

    ((encoder_mode == ATOM_ENCODER_MODE_HDMI) ||

     ENCODER_MODE_IS_DP(encoder_mode)))

        radeon_audio_mode_set(encoder, adjusted_mode);b

So this code bypasses the calling of radeon_audio_mode_set().

I think that radeon_connector->audio should be set by RADEON_AUDIO_AUTO, at least for connectors which can output audio. I fixed the code like below, and it works for me. But I am not familiar with radeon DRM driver, and can't see the big picture. Can you review this code?

Thanks,
Hyungwon Hwang

drivers/gpu/drm/radeon/radeon_connectors.c +3 -2
index cfcc099..cf52ea5 100644
@@ -1975,11 +1975,12 @@ radeon_add_atom_connector(struct drm_device
 *dev,
 
 rdev->mode_info.output_csc_property,
 
 RADEON_OUTPUT_CSC_BYPASS);
                        break;
-               case DRM_MODE_CONNECTOR_DVII:
-               case DRM_MODE_CONNECTOR_DVID:
                case DRM_MODE_CONNECTOR_HDMIA:
                case DRM_MODE_CONNECTOR_HDMIB:
                case DRM_MODE_CONNECTOR_DisplayPort:
+                       radeon_connector->audio = RADEON_AUDIO_AUTO;
+               case DRM_MODE_CONNECTOR_DVII:
+               case DRM_MODE_CONNECTOR_DVID:
                        drm_connector_init(dev, &radeon_connector->base,
                                           &radeon_dp_connector_funcs,
connector_type);
                        drm_connector_helper_add(&radeon_connector->base,
drivers/gpu/drm/radeon/radeon_connectors.c +2 -1
@@ -2024,8 +2025,9 @@ radeon_add_atom_connector(struct drm_device
 *dev,
                                                              1);
                        }
                        break;
-               case DRM_MODE_CONNECTOR_LVDS:
                case DRM_MODE_CONNECTOR_eDP:
+                       radeon_connector->audio = RADEON_AUDIO_AUTO;
+               case DRM_MODE_CONNECTOR_LVDS:
                        drm_connector_init(dev, &radeon_connector->base,
 
&radeon_lvds_bridge_connector_funcs, connector_type);
                        drm_connector_helper_add(&radeon_connector->base,
drivers/gpu/drm/radeon/radeon_connectors.c +1 -0
@@ -2196,6 +2198,7 @@ radeon_add_atom_connector(struct drm_device
 *dev,
                                connector->doublescan_allowed = true;
                        else
                                connector->doublescan_allowed = false;
+                       radeon_connector->audio = RADEON_AUDIO_AUTO;
                        break;
                case DRM_MODE_CONNECTOR_DisplayPort:

radeon_dig_connector = kzalloc(sizeof(struct
radeon_connector_atom_dig), GFP_KERNEL);

drivers/gpu/drm/radeon/radeon_connectors.c +1 -0
@@ -2245,6 +2248,7 @@ radeon_add_atom_connector(struct drm_device
 *dev,
                        connector->interlace_allowed = true;
                        /* in theory with a DP to VGA converter... */
                        connector->doublescan_allowed = false;
+                       radeon_connector->audio = RADEON_AUDIO_AUTO;
                        break;
                case DRM_MODE_CONNECTOR_eDP:

radeon_dig_connector = kzalloc(sizeof(struct
radeon_connector_atom_dig), GFP_KERNEL);

drivers/gpu/drm/radeon/radeon_connectors.c +0 -0
@@ -2267,6 +2271,7 @@ radeon_add_atom_connector(struct drm_device
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/radeon/radeon_connectors.c +1 -0
 *dev,
                        subpixel_order = SubPixelHorizontalRGB;
                        connector->interlace_allowed = false;
                        connector->doublescan_allowed = false;
+                       radeon_connector->audio = RADEON_AUDIO_AUTO;
                        break;
                case DRM_MODE_CONNECTOR_SVIDEO:

case DRM_MODE_CONNECTOR_Composite:

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel