diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-08-05 09:59:22 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-08-05 10:00:56 +0100 |
commit | a8919ab2967a8425e1cdc04b73702ce534f6abf0 (patch) | |
tree | 73da3cb7b72e0e847184e4940759deec166fa432 /src | |
parent | 622e600069ab0efd22586c7a71eecbd4baf21c40 (diff) |
Revert "display: Cache whether we have probed for an EDID"
Dave Airlie advised that hotplug detection can be unreliable and that
mode caching, in general, should be done in the kernel in any case.
This reverts commit 622e600069ab0efd22586c7a71eecbd4baf21c40.
Diffstat (limited to 'src')
-rw-r--r-- | src/intel_display.c | 54 |
1 files changed, 25 insertions, 29 deletions
diff --git a/src/intel_display.c b/src/intel_display.c index 061d2223..15399768 100644 --- a/src/intel_display.c +++ b/src/intel_display.c @@ -82,7 +82,6 @@ struct intel_output { int output_id; drmModeConnectorPtr mode_output; drmModeEncoderPtr mode_encoder; - Bool have_edid; drmModePropertyBlobPtr edid_blob; int num_props; struct intel_property *props; @@ -677,8 +676,6 @@ intel_output_detect(xf86OutputPtr output) struct intel_mode *mode = intel_output->mode; xf86OutputStatus status; - intel_output->have_edid = FALSE; - drmModeFreeConnector(intel_output->mode_output); intel_output->mode_output = drmModeGetConnector(mode->fd, intel_output->output_id); @@ -770,41 +767,40 @@ intel_output_get_modes(xf86OutputPtr output) struct intel_output *intel_output = output->driver_private; drmModeConnectorPtr koutput = intel_output->mode_output; struct intel_mode *mode = intel_output->mode; + int i; DisplayModePtr Modes = NULL, Mode; + drmModePropertyPtr props; drmModeModeInfo *mode_ptr; - int i; - if (!intel_output->have_edid) { - /* look for an EDID property */ - for (i = 0; i < koutput->count_props; i++) { - drmModePropertyPtr props; - - props = drmModeGetProperty(mode->fd, koutput->props[i]); - if (!props) - continue; - - if ((props->flags & DRM_MODE_PROP_BLOB) && - strcmp(props->name, "EDID") == 0) { - drmModeFreePropertyBlob(intel_output->edid_blob); - intel_output->edid_blob = - drmModeGetPropertyBlob(mode->fd, - koutput->prop_values[i]); - } + /* look for an EDID property */ + for (i = 0; i < koutput->count_props; i++) { + props = drmModeGetProperty(mode->fd, koutput->props[i]); + if (!props) + continue; + if (!(props->flags & DRM_MODE_PROP_BLOB)) { drmModeFreeProperty(props); + continue; } - if (intel_output->edid_blob) - xf86OutputSetEDID(output, - xf86InterpretEDID(output->scrn->scrnIndex, - intel_output->edid_blob->data)); - else - xf86OutputSetEDID(output, - xf86InterpretEDID(output->scrn->scrnIndex, - NULL)); - intel_output->have_edid = TRUE; + if (!strcmp(props->name, "EDID")) { + drmModeFreePropertyBlob(intel_output->edid_blob); + intel_output->edid_blob = + drmModeGetPropertyBlob(mode->fd, + koutput->prop_values[i]); + } + drmModeFreeProperty(props); } + if (intel_output->edid_blob) + xf86OutputSetEDID(output, + xf86InterpretEDID(output->scrn->scrnIndex, + intel_output->edid_blob->data)); + else + xf86OutputSetEDID(output, + xf86InterpretEDID(output->scrn->scrnIndex, + NULL)); + /* modes should already be available */ for (i = 0; i < koutput->count_modes; i++) { Mode = xnfalloc(sizeof(DisplayModeRec)); |