]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/radeon: consolidate duplicate encode is digital function
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 18 Sep 2014 20:27:46 +0000 (16:27 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 1 Oct 2014 13:00:02 +0000 (09:00 -0400)
Only need one copy.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/atombios_encoders.c
drivers/gpu/drm/radeon/r600_audio.c
drivers/gpu/drm/radeon/radeon_encoders.c
drivers/gpu/drm/radeon/radeon_mode.h

index a7f2ddf09a9d20024a0cca95e70d3f3b8ff5fc12..b8cd7975f797e7d09bb3792ff3af15462cba68a6 100644 (file)
@@ -291,29 +291,6 @@ static void radeon_atom_backlight_exit(struct radeon_encoder *encoder)
 bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index,
                                struct drm_display_mode *mode);
 
-
-static inline bool radeon_encoder_is_digital(struct drm_encoder *encoder)
-{
-       struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
-       switch (radeon_encoder->encoder_id) {
-       case ENCODER_OBJECT_ID_INTERNAL_LVDS:
-       case ENCODER_OBJECT_ID_INTERNAL_TMDS1:
-       case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_TMDS1:
-       case ENCODER_OBJECT_ID_INTERNAL_LVTM1:
-       case ENCODER_OBJECT_ID_INTERNAL_DVO1:
-       case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1:
-       case ENCODER_OBJECT_ID_INTERNAL_DDI:
-       case ENCODER_OBJECT_ID_INTERNAL_UNIPHY:
-       case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_LVTMA:
-       case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1:
-       case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2:
-       case ENCODER_OBJECT_ID_INTERNAL_UNIPHY3:
-               return true;
-       default:
-               return false;
-       }
-}
-
 static bool radeon_atom_mode_fixup(struct drm_encoder *encoder,
                                   const struct drm_display_mode *mode,
                                   struct drm_display_mode *adjusted_mode)
index bffac10c4296b3b4c28d9f7a52322fe51e9ae7c5..4c7163c1b656ff4b91b6c906eda5bd5c7ea1ede5 100644 (file)
 #include "radeon_asic.h"
 #include "atom.h"
 
-/*
- * check if enc_priv stores radeon_encoder_atom_dig
- */
-static bool radeon_dig_encoder(struct drm_encoder *encoder)
-{
-       struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
-       switch (radeon_encoder->encoder_id) {
-       case ENCODER_OBJECT_ID_INTERNAL_LVDS:
-       case ENCODER_OBJECT_ID_INTERNAL_TMDS1:
-       case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_TMDS1:
-       case ENCODER_OBJECT_ID_INTERNAL_LVTM1:
-       case ENCODER_OBJECT_ID_INTERNAL_DVO1:
-       case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1:
-       case ENCODER_OBJECT_ID_INTERNAL_DDI:
-       case ENCODER_OBJECT_ID_INTERNAL_UNIPHY:
-       case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_LVTMA:
-       case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1:
-       case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2:
-               return true;
-       }
-       return false;
-}
-
 /*
  * check if the chipset is supported
  */
@@ -134,7 +111,7 @@ void r600_audio_update_hdmi(struct work_struct *work)
        }
 
        list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
-               if (!radeon_dig_encoder(encoder))
+               if (!radeon_encoder_is_digital(encoder))
                        continue;
                if (changed || r600_hdmi_buffer_status_changed(encoder))
                        r600_hdmi_update_audio_settings(encoder);
index 3c2094c25b537516a8b181e26fd2bca00dca0411..109843dab5e596710ebeb3cf931bbc8523ab7c96 100644 (file)
@@ -382,3 +382,24 @@ bool radeon_dig_monitor_is_duallink(struct drm_encoder *encoder,
        }
 }
 
+bool radeon_encoder_is_digital(struct drm_encoder *encoder)
+{
+       struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
+       switch (radeon_encoder->encoder_id) {
+       case ENCODER_OBJECT_ID_INTERNAL_LVDS:
+       case ENCODER_OBJECT_ID_INTERNAL_TMDS1:
+       case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_TMDS1:
+       case ENCODER_OBJECT_ID_INTERNAL_LVTM1:
+       case ENCODER_OBJECT_ID_INTERNAL_DVO1:
+       case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1:
+       case ENCODER_OBJECT_ID_INTERNAL_DDI:
+       case ENCODER_OBJECT_ID_INTERNAL_UNIPHY:
+       case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_LVTMA:
+       case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1:
+       case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2:
+       case ENCODER_OBJECT_ID_INTERNAL_UNIPHY3:
+               return true;
+       default:
+               return false;
+       }
+}
index e27608c29c112f5e8d164214ca7b56855ef15593..04db2fdd869271f81482e75913d6ec4002ffecac 100644 (file)
@@ -777,6 +777,7 @@ extern void atombios_digital_setup(struct drm_encoder *encoder, int action);
 extern int atombios_get_encoder_mode(struct drm_encoder *encoder);
 extern bool atombios_set_edp_panel_power(struct drm_connector *connector, int action);
 extern void radeon_encoder_set_active_device(struct drm_encoder *encoder);
+extern bool radeon_encoder_is_digital(struct drm_encoder *encoder);
 
 extern void radeon_crtc_load_lut(struct drm_crtc *crtc);
 extern int atombios_crtc_set_base(struct drm_crtc *crtc, int x, int y,