Commit c5e4df33 authored by Zhenyu Wang's avatar Zhenyu Wang Committed by Eric Anholt

drm/i915: more conversion from connector_list walk to encoder_list

What we really want is encoder info instead of connector, so change
some more list walk in pipeline setup functions from connector_list
to encoder_list.
Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: default avatarEric Anholt <eric@anholt.net>
parent 5bf4c9c4
...@@ -741,12 +741,11 @@ bool intel_pipe_has_type (struct drm_crtc *crtc, int type) ...@@ -741,12 +741,11 @@ bool intel_pipe_has_type (struct drm_crtc *crtc, int type)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct drm_mode_config *mode_config = &dev->mode_config; struct drm_mode_config *mode_config = &dev->mode_config;
struct drm_connector *l_entry; struct drm_encoder *l_entry;
list_for_each_entry(l_entry, &mode_config->connector_list, head) { list_for_each_entry(l_entry, &mode_config->encoder_list, head) {
if (l_entry->encoder && if (l_entry && l_entry->crtc == crtc) {
l_entry->encoder->crtc == crtc) { struct intel_encoder *intel_encoder = enc_to_intel_encoder(l_entry);
struct intel_encoder *intel_encoder = to_intel_encoder(l_entry);
if (intel_encoder->type == type) if (intel_encoder->type == type)
return true; return true;
} }
...@@ -2923,7 +2922,8 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, ...@@ -2923,7 +2922,8 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
bool is_crt = false, is_lvds = false, is_tv = false, is_dp = false; bool is_crt = false, is_lvds = false, is_tv = false, is_dp = false;
bool is_edp = false; bool is_edp = false;
struct drm_mode_config *mode_config = &dev->mode_config; struct drm_mode_config *mode_config = &dev->mode_config;
struct drm_connector *connector; struct drm_encoder *encoder;
struct intel_encoder *intel_encoder;
const intel_limit_t *limit; const intel_limit_t *limit;
int ret; int ret;
struct fdi_m_n m_n = {0}; struct fdi_m_n m_n = {0};
...@@ -2941,12 +2941,13 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, ...@@ -2941,12 +2941,13 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
drm_vblank_pre_modeset(dev, pipe); drm_vblank_pre_modeset(dev, pipe);
list_for_each_entry(connector, &mode_config->connector_list, head) { list_for_each_entry(encoder, &mode_config->encoder_list, head) {
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
if (!connector->encoder || connector->encoder->crtc != crtc) if (!encoder || encoder->crtc != crtc)
continue; continue;
intel_encoder = enc_to_intel_encoder(encoder);
switch (intel_encoder->type) { switch (intel_encoder->type) {
case INTEL_OUTPUT_LVDS: case INTEL_OUTPUT_LVDS:
is_lvds = true; is_lvds = true;
...@@ -4391,14 +4392,14 @@ struct drm_crtc *intel_get_crtc_from_pipe(struct drm_device *dev, int pipe) ...@@ -4391,14 +4392,14 @@ struct drm_crtc *intel_get_crtc_from_pipe(struct drm_device *dev, int pipe)
return crtc; return crtc;
} }
static int intel_connector_clones(struct drm_device *dev, int type_mask) static int intel_encoder_clones(struct drm_device *dev, int type_mask)
{ {
int index_mask = 0; int index_mask = 0;
struct drm_connector *connector; struct drm_encoder *encoder;
int entry = 0; int entry = 0;
list_for_each_entry(connector, &dev->mode_config.connector_list, head) { list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
struct intel_encoder *intel_encoder = to_intel_encoder(connector); struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder);
if (type_mask & intel_encoder->clone_mask) if (type_mask & intel_encoder->clone_mask)
index_mask |= (1 << entry); index_mask |= (1 << entry);
entry++; entry++;
...@@ -4410,7 +4411,7 @@ static int intel_connector_clones(struct drm_device *dev, int type_mask) ...@@ -4410,7 +4411,7 @@ static int intel_connector_clones(struct drm_device *dev, int type_mask)
static void intel_setup_outputs(struct drm_device *dev) static void intel_setup_outputs(struct drm_device *dev)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
struct drm_connector *connector; struct drm_encoder *encoder;
intel_crt_init(dev); intel_crt_init(dev);
...@@ -4493,12 +4494,11 @@ static void intel_setup_outputs(struct drm_device *dev) ...@@ -4493,12 +4494,11 @@ static void intel_setup_outputs(struct drm_device *dev)
if (SUPPORTS_TV(dev)) if (SUPPORTS_TV(dev))
intel_tv_init(dev); intel_tv_init(dev);
list_for_each_entry(connector, &dev->mode_config.connector_list, head) { list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
struct intel_encoder *intel_encoder = to_intel_encoder(connector); struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder);
struct drm_encoder *encoder = &intel_encoder->enc;
encoder->possible_crtcs = intel_encoder->crtc_mask; encoder->possible_crtcs = intel_encoder->crtc_mask;
encoder->possible_clones = intel_connector_clones(dev, encoder->possible_clones = intel_encoder_clones(dev,
intel_encoder->clone_mask); intel_encoder->clone_mask);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment