Commit 4d322e94 authored by Ben Widawsky's avatar Ben Widawsky

drm-atomic: Fix the slashes, dammit

Signed-off-by: 's avatarBen Widawsky <ben@bwidawsk.net>
parent 592a6770
......@@ -367,36 +367,35 @@ const struct drm * init_drm_atomic(const char *device)
drm.connector = calloc(1, sizeof(*drm.connector));
#define get_resource(type, Type, id) do { \
drm.type->type = drmModeGet##Type(drm.fd, id); \
if (!drm.type->type) { \
printf("could not get %s %i: %s\n", \
#type, id, strerror(errno)); \
return NULL; \
} \
drm.type->type = drmModeGet##Type(drm.fd, id); \
if (!drm.type->type) { \
printf("could not get %s %i: %s\n", \
#type, id, strerror(errno)); \
return NULL; \
} \
} while (0)
get_resource(plane, Plane, plane_id);
get_resource(crtc, Crtc, drm.crtc_id);
get_resource(connector, Connector, drm.connector_id);
#define get_properties(type, TYPE, id) do { \
uint32_t i; \
drm.type->props = drmModeObjectGetProperties(drm.fd, \
id, DRM_MODE_OBJECT_##TYPE); \
if (!drm.type->props) { \
printf("could not get %s %u properties: %s\n", \
#type, id, strerror(errno)); \
return NULL; \
} \
drm.type->props_info = calloc(drm.type->props->count_props, \
sizeof(drm.type->props_info)); \
for (i = 0; i < drm.type->props->count_props; i++) { \
drm.type->props_info[i] = drmModeGetProperty(drm.fd,\
drm.type->props->props[i]); \
} \
#define get_properties(type, TYPE, id) do { \
uint32_t i; \
drm.type->props = drmModeObjectGetProperties(drm.fd, \
id, DRM_MODE_OBJECT_##TYPE); \
if (!drm.type->props) { \
printf("could not get %s %u properties: %s\n", \
#type, id, strerror(errno)); \
return NULL; \
} \
drm.type->props_info = calloc(drm.type->props->count_props, \
sizeof(drm.type->props_info)); \
for (i = 0; i < drm.type->props->count_props; i++) { \
drm.type->props_info[i] = drmModeGetProperty(drm.fd, \
drm.type->props->props[i]); \
} \
} while (0)
get_properties(plane, PLANE, plane_id);
get_properties(crtc, CRTC, drm.crtc_id);
get_properties(connector, CONNECTOR, drm.connector_id);
......
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