diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-05-29 12:45:20 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-05-29 12:46:11 +0100 |
commit | 3c074797094dc7675bb6ae549630fdf061ab5258 (patch) | |
tree | d267d821192461f883bd4261cbddbd93d916b416 /src/sna/sna_display.c | |
parent | 560e50c0a5afa0824086557581ca6aa5696b44a2 (diff) |
sna: Make GetEDID valgrind clean.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_display.c')
-rw-r--r-- | src/sna/sna_display.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 1f67499b..b8e69b52 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -1086,24 +1086,22 @@ sna_output_attach_edid(xf86OutputPtr output) /* look for an EDID property */ for (i = 0; i < koutput->count_props; i++) { - drmModePropertyPtr props; + struct drm_mode_get_property prop; - props = drmModeGetProperty(sna->kgem.fd, koutput->props[i]); - if (!props) + VG_CLEAR(prop); + prop.prop_id = koutput->props[i]; + if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETPROPERTY, &prop)) continue; - if (!(props->flags & DRM_MODE_PROP_BLOB)) { - drmModeFreeProperty(props); + if (!(prop.flags & DRM_MODE_PROP_BLOB)) continue; - } - if (!strcmp(props->name, "EDID")) { - drmModeFreePropertyBlob(edid_blob); - edid_blob = - drmModeGetPropertyBlob(sna->kgem.fd, - koutput->prop_values[i]); - } - drmModeFreeProperty(props); + if (strcmp(prop.name, "EDID")) + continue; + + drmModeFreePropertyBlob(edid_blob); + edid_blob = drmModeGetPropertyBlob(sna->kgem.fd, + koutput->prop_values[i]); } if (edid_blob) { |