summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2013-07-31 18:50:51 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-07-31 18:57:28 +0100
commitc5e3b66c27e8960a39ba0fc9108e04a67e1c2d98 (patch)
treed0f6209bd9f08a3d6a766457f961932326adfb02 /src
parent278ee155d572d3132d27823bb69995a8cc61c2c0 (diff)
uxa/display: Keep the EDID blob around for the lifetime of an output
xf86InterpretEDID() doesn't copy the EDID raw data in xf86MonPtr but just stores the given pointer. The DDX driver needs to make sure that data stays valid. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/uxa/intel_display.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/uxa/intel_display.c b/src/uxa/intel_display.c
index 02f2dcbd..b4f7e87a 100644
--- a/src/uxa/intel_display.c
+++ b/src/uxa/intel_display.c
@@ -105,6 +105,7 @@ struct intel_output {
int output_id;
drmModeConnectorPtr mode_output;
drmModeEncoderPtr mode_encoder;
+ drmModePropertyBlobPtr edid_blob;
int num_props;
struct intel_property *props;
void *private_data;
@@ -920,7 +921,6 @@ intel_output_attach_edid(xf86OutputPtr output)
struct intel_output *intel_output = output->driver_private;
drmModeConnectorPtr koutput = intel_output->mode_output;
struct intel_mode *mode = intel_output->mode;
- drmModePropertyBlobPtr edid_blob = NULL;
xf86MonPtr mon = NULL;
int i;
@@ -938,26 +938,23 @@ intel_output_attach_edid(xf86OutputPtr output)
}
if (!strcmp(props->name, "EDID")) {
- drmModeFreePropertyBlob(edid_blob);
- edid_blob =
+ drmModeFreePropertyBlob(intel_output->edid_blob);
+ intel_output->edid_blob =
drmModeGetPropertyBlob(mode->fd,
koutput->prop_values[i]);
}
drmModeFreeProperty(props);
}
- if (edid_blob) {
+ if (intel_output->edid_blob) {
mon = xf86InterpretEDID(output->scrn->scrnIndex,
- edid_blob->data);
+ intel_output->edid_blob->data);
- if (mon && edid_blob->length > 128)
+ if (mon && intel_output->edid_blob->length > 128)
mon->flags |= MONITOR_EDID_COMPLETE_RAWDATA;
}
xf86OutputSetEDID(output, mon);
-
- if (edid_blob)
- drmModeFreePropertyBlob(edid_blob);
}
static DisplayModePtr
@@ -1061,6 +1058,8 @@ intel_output_destroy(xf86OutputPtr output)
struct intel_output *intel_output = output->driver_private;
int i;
+ drmModeFreePropertyBlob(intel_output->edid_blob);
+
for (i = 0; i < intel_output->num_props; i++) {
drmModeFreeProperty(intel_output->props[i].mode_prop);
free(intel_output->props[i].atoms);