diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2009-10-14 02:00:42 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-10-14 20:30:23 -0400 |
commit | 8c2a6d730400e14bf28ccfa11b9bbf453db775ec (patch) | |
tree | e62b5d600ae2bee724568d63ad3c27c8e072db6c /drivers/gpu/drm/radeon/radeon_encoders.c | |
parent | fb06ca8f8c61dfd7cbfa2092756577ff78a26dcd (diff) |
drm/radeon/kms: move active_device setup into encoder fixup()
radeon_encoder->active_device defines the active routing
between the encoder and connector. The encoder fixup and
dpms functions need to know the active_device to function
properly. Setting active_device in the prepare hook was
too late in some cases.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_encoders.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_encoders.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index 10845f39124a..6cdef27be99d 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c | |||
@@ -194,6 +194,8 @@ static bool radeon_atom_mode_fixup(struct drm_encoder *encoder, | |||
194 | struct drm_device *dev = encoder->dev; | 194 | struct drm_device *dev = encoder->dev; |
195 | struct radeon_device *rdev = dev->dev_private; | 195 | struct radeon_device *rdev = dev->dev_private; |
196 | 196 | ||
197 | /* set the active encoder to connector routing */ | ||
198 | radeon_encoder_set_active_device(encoder); | ||
197 | drm_mode_set_crtcinfo(adjusted_mode, 0); | 199 | drm_mode_set_crtcinfo(adjusted_mode, 0); |
198 | 200 | ||
199 | if (radeon_encoder->rmx_type != RMX_OFF) | 201 | if (radeon_encoder->rmx_type != RMX_OFF) |
@@ -860,16 +862,9 @@ radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode) | |||
860 | DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION args; | 862 | DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION args; |
861 | int index = 0; | 863 | int index = 0; |
862 | bool is_dig = false; | 864 | bool is_dig = false; |
863 | int devices; | ||
864 | 865 | ||
865 | memset(&args, 0, sizeof(args)); | 866 | memset(&args, 0, sizeof(args)); |
866 | 867 | ||
867 | /* on DPMS off we have no idea if active device is meaningful */ | ||
868 | if (mode != DRM_MODE_DPMS_ON && !radeon_encoder->active_device) | ||
869 | devices = radeon_encoder->devices; | ||
870 | else | ||
871 | devices = radeon_encoder->active_device; | ||
872 | |||
873 | DRM_DEBUG("encoder dpms %d to mode %d, devices %08x, active_devices %08x\n", | 868 | DRM_DEBUG("encoder dpms %d to mode %d, devices %08x, active_devices %08x\n", |
874 | radeon_encoder->encoder_id, mode, radeon_encoder->devices, | 869 | radeon_encoder->encoder_id, mode, radeon_encoder->devices, |
875 | radeon_encoder->active_device); | 870 | radeon_encoder->active_device); |
@@ -900,18 +895,18 @@ radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode) | |||
900 | break; | 895 | break; |
901 | case ENCODER_OBJECT_ID_INTERNAL_DAC1: | 896 | case ENCODER_OBJECT_ID_INTERNAL_DAC1: |
902 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC1: | 897 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC1: |
903 | if (devices & (ATOM_DEVICE_TV_SUPPORT)) | 898 | if (radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT)) |
904 | index = GetIndexIntoMasterTable(COMMAND, TV1OutputControl); | 899 | index = GetIndexIntoMasterTable(COMMAND, TV1OutputControl); |
905 | else if (devices & (ATOM_DEVICE_CV_SUPPORT)) | 900 | else if (radeon_encoder->active_device & (ATOM_DEVICE_CV_SUPPORT)) |
906 | index = GetIndexIntoMasterTable(COMMAND, CV1OutputControl); | 901 | index = GetIndexIntoMasterTable(COMMAND, CV1OutputControl); |
907 | else | 902 | else |
908 | index = GetIndexIntoMasterTable(COMMAND, DAC1OutputControl); | 903 | index = GetIndexIntoMasterTable(COMMAND, DAC1OutputControl); |
909 | break; | 904 | break; |
910 | case ENCODER_OBJECT_ID_INTERNAL_DAC2: | 905 | case ENCODER_OBJECT_ID_INTERNAL_DAC2: |
911 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC2: | 906 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC2: |
912 | if (devices & (ATOM_DEVICE_TV_SUPPORT)) | 907 | if (radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT)) |
913 | index = GetIndexIntoMasterTable(COMMAND, TV1OutputControl); | 908 | index = GetIndexIntoMasterTable(COMMAND, TV1OutputControl); |
914 | else if (devices & (ATOM_DEVICE_CV_SUPPORT)) | 909 | else if (radeon_encoder->active_device & (ATOM_DEVICE_CV_SUPPORT)) |
915 | index = GetIndexIntoMasterTable(COMMAND, CV1OutputControl); | 910 | index = GetIndexIntoMasterTable(COMMAND, CV1OutputControl); |
916 | else | 911 | else |
917 | index = GetIndexIntoMasterTable(COMMAND, DAC2OutputControl); | 912 | index = GetIndexIntoMasterTable(COMMAND, DAC2OutputControl); |
@@ -1254,8 +1249,6 @@ static void radeon_atom_encoder_prepare(struct drm_encoder *encoder) | |||
1254 | { | 1249 | { |
1255 | radeon_atom_output_lock(encoder, true); | 1250 | radeon_atom_output_lock(encoder, true); |
1256 | radeon_atom_encoder_dpms(encoder, DRM_MODE_DPMS_OFF); | 1251 | radeon_atom_encoder_dpms(encoder, DRM_MODE_DPMS_OFF); |
1257 | |||
1258 | radeon_encoder_set_active_device(encoder); | ||
1259 | } | 1252 | } |
1260 | 1253 | ||
1261 | static void radeon_atom_encoder_commit(struct drm_encoder *encoder) | 1254 | static void radeon_atom_encoder_commit(struct drm_encoder *encoder) |