diff mbox

drm/radeon: fix dpms on/off on trinity/aruba

Message ID 1343161778-27066-1-git-send-email-j.glisse@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jerome Glisse July 24, 2012, 8:29 p.m. UTC
From: Jerome Glisse <jglisse@redhat.com>

The external encoder need to be setup again before enabling the
transmiter. This seems to be only needed on some trinity/aruba
to fix dpms on.

Cc: <stable@kernel.org>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
---
 drivers/gpu/drm/radeon/atombios_encoders.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Alex Deucher July 24, 2012, 8:41 p.m. UTC | #1
On Tue, Jul 24, 2012 at 4:29 PM,  <j.glisse@gmail.com> wrote:
> From: Jerome Glisse <jglisse@redhat.com>
>
> The external encoder need to be setup again before enabling the
> transmiter. This seems to be only needed on some trinity/aruba
> to fix dpms on.
>
> Cc: <stable@kernel.org>
> Signed-off-by: Jerome Glisse <jglisse@redhat.com>
> ---
>  drivers/gpu/drm/radeon/atombios_encoders.c |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c
> index 486ccdf..5302c42 100644
> --- a/drivers/gpu/drm/radeon/atombios_encoders.c
> +++ b/drivers/gpu/drm/radeon/atombios_encoders.c
> @@ -1392,10 +1392,12 @@ radeon_atom_encoder_dpms_dig(struct drm_encoder *encoder, int mode)
>         case DRM_MODE_DPMS_ON:
>                 /* some early dce3.2 boards have a bug in their transmitter control table */
>                 if ((rdev->family == CHIP_RV710) || (rdev->family == CHIP_RV730) ||
> -                   ASIC_IS_DCE41(rdev) || ASIC_IS_DCE5(rdev))
> +                   ASIC_IS_DCE41(rdev) || ASIC_IS_DCE5(rdev)) {
> +                       atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_SETUP, 0);
>                         atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE, 0, 0);

Maybe make a separate case for DCE61 here?  We don't need to execute
ATOM_ENCODER_CMD_SETUP again here on other asics.  Also the current
code already calls these two actions in the same order via
radeon_atom_encoder_mode_set() and then
radeon_atom_encoder_dpms_dig().  The difference being that in the
current ordering there are calls to

			atombios_dig_encoder_setup(encoder,

ATOM_ENCODER_CMD_SETUP_PANEL_MODE,
                                                   dig->panel_mode);
and
        	        atombios_external_encoder_setup(encoder, ext_encoder,

EXTERNAL_ENCODER_ACTION_V3_ENCODER_SETUP);

in between.  Does changing the order in radeon_atom_encoder_mode_set()
also fix the issue?  e.g.
atombios_dig_encoder_setup(encoder,

ATOM_ENCODER_CMD_SETUP_PANEL_MODE,
                                                   dig->panel_mode);
atombios_external_encoder_setup(encoder, ext_encoder,

EXTERNAL_ENCODER_ACTION_V3_ENCODER_SETUP);
atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_SETUP, 0);

followed by radeon_atom_encoder_dpms_dig():
atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE, 0, 0);

Alex
Jerome Glisse July 24, 2012, 8:52 p.m. UTC | #2
On Tue, Jul 24, 2012 at 4:41 PM, Alex Deucher <alexdeucher@gmail.com> wrote:
> On Tue, Jul 24, 2012 at 4:29 PM,  <j.glisse@gmail.com> wrote:
>> From: Jerome Glisse <jglisse@redhat.com>
>>
>> The external encoder need to be setup again before enabling the
>> transmiter. This seems to be only needed on some trinity/aruba
>> to fix dpms on.
>>
>> Cc: <stable@kernel.org>
>> Signed-off-by: Jerome Glisse <jglisse@redhat.com>
>> ---
>>  drivers/gpu/drm/radeon/atombios_encoders.c |    6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c
>> index 486ccdf..5302c42 100644
>> --- a/drivers/gpu/drm/radeon/atombios_encoders.c
>> +++ b/drivers/gpu/drm/radeon/atombios_encoders.c
>> @@ -1392,10 +1392,12 @@ radeon_atom_encoder_dpms_dig(struct drm_encoder *encoder, int mode)
>>         case DRM_MODE_DPMS_ON:
>>                 /* some early dce3.2 boards have a bug in their transmitter control table */
>>                 if ((rdev->family == CHIP_RV710) || (rdev->family == CHIP_RV730) ||
>> -                   ASIC_IS_DCE41(rdev) || ASIC_IS_DCE5(rdev))
>> +                   ASIC_IS_DCE41(rdev) || ASIC_IS_DCE5(rdev)) {
>> +                       atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_SETUP, 0);
>>                         atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE, 0, 0);
>
> Maybe make a separate case for DCE61 here?  We don't need to execute
> ATOM_ENCODER_CMD_SETUP again here on other asics.  Also the current
> code already calls these two actions in the same order via
> radeon_atom_encoder_mode_set() and then
> radeon_atom_encoder_dpms_dig().  The difference being that in the
> current ordering there are calls to
>
>                         atombios_dig_encoder_setup(encoder,
>
> ATOM_ENCODER_CMD_SETUP_PANEL_MODE,
>                                                    dig->panel_mode);
> and
>                         atombios_external_encoder_setup(encoder, ext_encoder,
>
> EXTERNAL_ENCODER_ACTION_V3_ENCODER_SETUP);
>
> in between.  Does changing the order in radeon_atom_encoder_mode_set()
> also fix the issue?  e.g.
> atombios_dig_encoder_setup(encoder,
>
> ATOM_ENCODER_CMD_SETUP_PANEL_MODE,
>                                                    dig->panel_mode);
> atombios_external_encoder_setup(encoder, ext_encoder,
>
> EXTERNAL_ENCODER_ACTION_V3_ENCODER_SETUP);
> atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_SETUP, 0);
>
> followed by radeon_atom_encoder_dpms_dig():
> atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE, 0, 0);
>
> Alex

On dpms on we don't call encoder_mode_set

Cheers,
Jerome
diff mbox

Patch

diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c
index 486ccdf..5302c42 100644
--- a/drivers/gpu/drm/radeon/atombios_encoders.c
+++ b/drivers/gpu/drm/radeon/atombios_encoders.c
@@ -1392,10 +1392,12 @@  radeon_atom_encoder_dpms_dig(struct drm_encoder *encoder, int mode)
 	case DRM_MODE_DPMS_ON:
 		/* some early dce3.2 boards have a bug in their transmitter control table */
 		if ((rdev->family == CHIP_RV710) || (rdev->family == CHIP_RV730) ||
-		    ASIC_IS_DCE41(rdev) || ASIC_IS_DCE5(rdev))
+		    ASIC_IS_DCE41(rdev) || ASIC_IS_DCE5(rdev)) {
+			atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_SETUP, 0);
 			atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE, 0, 0);
-		else
+		} else {
 			atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE_OUTPUT, 0, 0);
+		}
 		if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(encoder)) && connector) {
 			if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) {
 				atombios_set_edp_panel_power(connector,