drm/i915: Give encoders useful names
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 27 May 2016 17:59:24 +0000 (20:59 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 30 May 2016 14:02:26 +0000 (17:02 +0300)
Rather than let the core generate usless encoder names, let's pass in
something that actually identifies the piece of hardware we're dealing
with.

v2: Use 'DSI %c' instead of 'MIPI %c' for DSI encoders (Jani)
v3: Use port_name() in DSI code since we have it

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1464371966-15190-7-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/intel_crt.c
drivers/gpu/drm/i915/intel_ddi.c
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_dp_mst.c
drivers/gpu/drm/i915/intel_dsi.c
drivers/gpu/drm/i915/intel_dvo.c
drivers/gpu/drm/i915/intel_hdmi.c
drivers/gpu/drm/i915/intel_lvds.c
drivers/gpu/drm/i915/intel_sdvo.c
drivers/gpu/drm/i915/intel_tv.c

index 3fbb6fc664516cdced5ab80ad1d0a8fe4cc70219..622968161ac7c103cf6d5aa75ab6bd4cbcc9c7d5 100644 (file)
@@ -839,7 +839,7 @@ void intel_crt_init(struct drm_device *dev)
                           &intel_crt_connector_funcs, DRM_MODE_CONNECTOR_VGA);
 
        drm_encoder_init(dev, &crt->base.base, &intel_crt_enc_funcs,
-                        DRM_MODE_ENCODER_DAC, NULL);
+                        DRM_MODE_ENCODER_DAC, "CRT");
 
        intel_connector_attach_encoder(intel_connector, &crt->base);
 
index c454744dda0b715704c6850cf18c490999ff4521..022b41d422dc85b0586f7d81a2e59afbc9fadc52 100644 (file)
@@ -2347,7 +2347,7 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
        encoder = &intel_encoder->base;
 
        drm_encoder_init(dev, encoder, &intel_ddi_funcs,
-                        DRM_MODE_ENCODER_TMDS, NULL);
+                        DRM_MODE_ENCODER_TMDS, "DDI %c", port_name(port));
 
        intel_encoder->compute_config = intel_ddi_compute_config;
        intel_encoder->enable = intel_enable_ddi;
index aa9c59ee17f63d0636555b7270e0e634354f2080..096acbf04003419cbaaf98ab84bf54f834010832 100644 (file)
@@ -5590,7 +5590,7 @@ intel_dp_init(struct drm_device *dev,
        encoder = &intel_encoder->base;
 
        if (drm_encoder_init(dev, &intel_encoder->base, &intel_dp_enc_funcs,
-                            DRM_MODE_ENCODER_TMDS, NULL))
+                            DRM_MODE_ENCODER_TMDS, "DP %c", port_name(port)))
                goto err_encoder_init;
 
        intel_encoder->compute_config = intel_dp_compute_config;
index 7a34090cef34e6a14276ab2cdfcbc4c498926be8..f62ca9a126b39e4942369e326be6be208bc33748 100644 (file)
@@ -534,7 +534,7 @@ intel_dp_create_fake_mst_encoder(struct intel_digital_port *intel_dig_port, enum
        intel_mst->primary = intel_dig_port;
 
        drm_encoder_init(dev, &intel_encoder->base, &intel_dp_mst_enc_funcs,
-                        DRM_MODE_ENCODER_DPMST, NULL);
+                        DRM_MODE_ENCODER_DPMST, "DP-MST %c", pipe_name(pipe));
 
        intel_encoder->type = INTEL_OUTPUT_DP_MST;
        intel_encoder->crtc_mask = 0x7;
index 4009618a5b34e3252c7ed125754a3d59f1d97eaf..cbe2537f26f49eb391d3e93e49457aebc9522396 100644 (file)
@@ -1450,7 +1450,7 @@ void intel_dsi_init(struct drm_device *dev)
        connector = &intel_connector->base;
 
        drm_encoder_init(dev, encoder, &intel_dsi_funcs, DRM_MODE_ENCODER_DSI,
-                        NULL);
+                        "DSI %c", port_name(port));
 
        intel_encoder->compute_config = intel_dsi_compute_config;
        intel_encoder->pre_enable = intel_dsi_pre_enable;
index 286baec979c84098321cf9039729f96480400fa0..a456f2eb68b6d28cabf1e9fc413a61a8581f3b0b 100644 (file)
@@ -406,6 +406,18 @@ intel_dvo_get_current_mode(struct drm_connector *connector)
        return mode;
 }
 
+static char intel_dvo_port_name(i915_reg_t dvo_reg)
+{
+       if (i915_mmio_reg_equal(dvo_reg, DVOA))
+               return 'A';
+       else if (i915_mmio_reg_equal(dvo_reg, DVOB))
+               return 'B';
+       else if (i915_mmio_reg_equal(dvo_reg, DVOC))
+               return 'C';
+       else
+               return '?';
+}
+
 void intel_dvo_init(struct drm_device *dev)
 {
        struct drm_i915_private *dev_priv = dev->dev_private;
@@ -428,8 +440,6 @@ void intel_dvo_init(struct drm_device *dev)
        intel_dvo->attached_connector = intel_connector;
 
        intel_encoder = &intel_dvo->base;
-       drm_encoder_init(dev, &intel_encoder->base,
-                        &intel_dvo_enc_funcs, encoder_type, NULL);
 
        intel_encoder->disable = intel_disable_dvo;
        intel_encoder->enable = intel_enable_dvo;
@@ -496,6 +506,10 @@ void intel_dvo_init(struct drm_device *dev)
                if (!dvoinit)
                        continue;
 
+               drm_encoder_init(dev, &intel_encoder->base,
+                                &intel_dvo_enc_funcs, encoder_type,
+                                "DVO %c", intel_dvo_port_name(dvo->dvo_reg));
+
                intel_encoder->type = INTEL_OUTPUT_DVO;
                intel_encoder->crtc_mask = (1 << 0) | (1 << 1);
                switch (dvo->type) {
index 6b52c6accf6a5e6ad76713806fc5028240584234..eb455ea6ea92ed6d0226bae00f23fe9c13411834 100644 (file)
@@ -1945,7 +1945,7 @@ void intel_hdmi_init(struct drm_device *dev,
        intel_encoder = &intel_dig_port->base;
 
        drm_encoder_init(dev, &intel_encoder->base, &intel_hdmi_enc_funcs,
-                        DRM_MODE_ENCODER_TMDS, NULL);
+                        DRM_MODE_ENCODER_TMDS, "HDMI %c", port_name(port));
 
        intel_encoder->compute_config = intel_hdmi_compute_config;
        if (HAS_PCH_SPLIT(dev)) {
index d65fd945607a35970819422d26e4b086f3ef89a7..56eb3bdcdb5c914dd77aaefdb665b8a2faf40f98 100644 (file)
@@ -978,7 +978,7 @@ void intel_lvds_init(struct drm_device *dev)
                           DRM_MODE_CONNECTOR_LVDS);
 
        drm_encoder_init(dev, &intel_encoder->base, &intel_lvds_enc_funcs,
-                        DRM_MODE_ENCODER_LVDS, NULL);
+                        DRM_MODE_ENCODER_LVDS, "LVDS");
 
        intel_encoder->enable = intel_enable_lvds;
        intel_encoder->pre_enable = intel_pre_enable_lvds;
index 2128fae5687d12a59c8d06ecc4003113abcc7944..1a71456bd12a3b9a251a5f40b6fe0cc19eea19b7 100644 (file)
@@ -2981,7 +2981,7 @@ bool intel_sdvo_init(struct drm_device *dev,
        intel_encoder = &intel_sdvo->base;
        intel_encoder->type = INTEL_OUTPUT_SDVO;
        drm_encoder_init(dev, &intel_encoder->base, &intel_sdvo_enc_funcs, 0,
-                        NULL);
+                        "SDVO %c", port_name(port));
 
        /* Read the regs to test if we can talk to the device */
        for (i = 0; i < 0x40; i++) {
index 223129d3c765afd836118121416a9a9650813c64..1f3a0e1e1a1fabb256bb6fffd78b74cd953b0591 100644 (file)
@@ -1591,7 +1591,7 @@ intel_tv_init(struct drm_device *dev)
                           DRM_MODE_CONNECTOR_SVIDEO);
 
        drm_encoder_init(dev, &intel_encoder->base, &intel_tv_enc_funcs,
-                        DRM_MODE_ENCODER_TVDAC, NULL);
+                        DRM_MODE_ENCODER_TVDAC, "TV");
 
        intel_encoder->compute_config = intel_tv_compute_config;
        intel_encoder->get_config = intel_tv_get_config;