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

drm/i915: passing drm connector param for load detection

In load detection, connector's encoder assignment must be kept
consistent for proper mode setting, and this makes connector as
explicit parameter for load detect function to not require single
data structure to hold both encoder and connector reference, ease
the transition for splitted encoder/connector model.
Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: default avatarEric Anholt <eric@anholt.net>
parent f1c79df3
...@@ -406,11 +406,12 @@ static enum drm_connector_status intel_crt_detect(struct drm_connector *connecto ...@@ -406,11 +406,12 @@ static enum drm_connector_status intel_crt_detect(struct drm_connector *connecto
if (encoder->crtc && encoder->crtc->enabled) { if (encoder->crtc && encoder->crtc->enabled) {
status = intel_crt_load_detect(encoder->crtc, intel_encoder); status = intel_crt_load_detect(encoder->crtc, intel_encoder);
} else { } else {
crtc = intel_get_load_detect_pipe(intel_encoder, crtc = intel_get_load_detect_pipe(intel_encoder, connector,
NULL, &dpms_mode); NULL, &dpms_mode);
if (crtc) { if (crtc) {
status = intel_crt_load_detect(crtc, intel_encoder); status = intel_crt_load_detect(crtc, intel_encoder);
intel_release_load_detect_pipe(intel_encoder, dpms_mode); intel_release_load_detect_pipe(intel_encoder,
connector, dpms_mode);
} else } else
status = connector_status_unknown; status = connector_status_unknown;
} }
......
...@@ -3671,6 +3671,7 @@ static struct drm_display_mode load_detect_mode = { ...@@ -3671,6 +3671,7 @@ static struct drm_display_mode load_detect_mode = {
}; };
struct drm_crtc *intel_get_load_detect_pipe(struct intel_encoder *intel_encoder, struct drm_crtc *intel_get_load_detect_pipe(struct intel_encoder *intel_encoder,
struct drm_connector *connector,
struct drm_display_mode *mode, struct drm_display_mode *mode,
int *dpms_mode) int *dpms_mode)
{ {
...@@ -3729,7 +3730,7 @@ struct drm_crtc *intel_get_load_detect_pipe(struct intel_encoder *intel_encoder, ...@@ -3729,7 +3730,7 @@ struct drm_crtc *intel_get_load_detect_pipe(struct intel_encoder *intel_encoder,
} }
encoder->crtc = crtc; encoder->crtc = crtc;
intel_encoder->base.encoder = encoder; connector->encoder = encoder;
intel_encoder->load_detect_temp = true; intel_encoder->load_detect_temp = true;
intel_crtc = to_intel_crtc(crtc); intel_crtc = to_intel_crtc(crtc);
...@@ -3755,7 +3756,8 @@ struct drm_crtc *intel_get_load_detect_pipe(struct intel_encoder *intel_encoder, ...@@ -3755,7 +3756,8 @@ struct drm_crtc *intel_get_load_detect_pipe(struct intel_encoder *intel_encoder,
return crtc; return crtc;
} }
void intel_release_load_detect_pipe(struct intel_encoder *intel_encoder, int dpms_mode) void intel_release_load_detect_pipe(struct intel_encoder *intel_encoder,
struct drm_connector *connector, int dpms_mode)
{ {
struct drm_encoder *encoder = &intel_encoder->enc; struct drm_encoder *encoder = &intel_encoder->enc;
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
...@@ -3765,7 +3767,7 @@ void intel_release_load_detect_pipe(struct intel_encoder *intel_encoder, int dpm ...@@ -3765,7 +3767,7 @@ void intel_release_load_detect_pipe(struct intel_encoder *intel_encoder, int dpm
if (intel_encoder->load_detect_temp) { if (intel_encoder->load_detect_temp) {
encoder->crtc = NULL; encoder->crtc = NULL;
intel_encoder->base.encoder = NULL; connector->encoder = NULL;
intel_encoder->load_detect_temp = false; intel_encoder->load_detect_temp = false;
crtc->enabled = drm_helper_crtc_in_use(crtc); crtc->enabled = drm_helper_crtc_in_use(crtc);
drm_helper_disable_unused_functions(dev); drm_helper_disable_unused_functions(dev);
......
...@@ -199,9 +199,11 @@ int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data, ...@@ -199,9 +199,11 @@ int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data,
extern void intel_wait_for_vblank(struct drm_device *dev); extern void intel_wait_for_vblank(struct drm_device *dev);
extern struct drm_crtc *intel_get_crtc_from_pipe(struct drm_device *dev, int pipe); extern struct drm_crtc *intel_get_crtc_from_pipe(struct drm_device *dev, int pipe);
extern struct drm_crtc *intel_get_load_detect_pipe(struct intel_encoder *intel_encoder, extern struct drm_crtc *intel_get_load_detect_pipe(struct intel_encoder *intel_encoder,
struct drm_connector *connector,
struct drm_display_mode *mode, struct drm_display_mode *mode,
int *dpms_mode); int *dpms_mode);
extern void intel_release_load_detect_pipe(struct intel_encoder *intel_encoder, extern void intel_release_load_detect_pipe(struct intel_encoder *intel_encoder,
struct drm_connector *connector,
int dpms_mode); int dpms_mode);
extern struct drm_connector* intel_sdvo_find(struct drm_device *dev, int sdvoB); extern struct drm_connector* intel_sdvo_find(struct drm_device *dev, int sdvoB);
......
...@@ -1496,10 +1496,12 @@ intel_tv_detect(struct drm_connector *connector) ...@@ -1496,10 +1496,12 @@ intel_tv_detect(struct drm_connector *connector)
if (encoder->crtc && encoder->crtc->enabled) { if (encoder->crtc && encoder->crtc->enabled) {
type = intel_tv_detect_type(encoder->crtc, intel_encoder); type = intel_tv_detect_type(encoder->crtc, intel_encoder);
} else { } else {
crtc = intel_get_load_detect_pipe(intel_encoder, &mode, &dpms_mode); crtc = intel_get_load_detect_pipe(intel_encoder, connector,
&mode, &dpms_mode);
if (crtc) { if (crtc) {
type = intel_tv_detect_type(crtc, intel_encoder); type = intel_tv_detect_type(crtc, intel_encoder);
intel_release_load_detect_pipe(intel_encoder, dpms_mode); intel_release_load_detect_pipe(intel_encoder, connector,
dpms_mode);
} else } else
type = -1; type = -1;
} }
......
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