drm-atomic: Fix the slashes, dammit
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Ben Widawsky
7 years ago
366 | 366 | drm.connector = calloc(1, sizeof(*drm.connector)); |
367 | 367 | |
368 | 368 | #define get_resource(type, Type, id) do { \ |
369 | drm.type->type = drmModeGet##Type(drm.fd, id); \ | |
370 | if (!drm.type->type) { \ | |
371 | printf("could not get %s %i: %s\n", \ | |
372 | #type, id, strerror(errno)); \ | |
373 | return NULL; \ | |
374 | } \ | |
369 | drm.type->type = drmModeGet##Type(drm.fd, id); \ | |
370 | if (!drm.type->type) { \ | |
371 | printf("could not get %s %i: %s\n", \ | |
372 | #type, id, strerror(errno)); \ | |
373 | return NULL; \ | |
374 | } \ | |
375 | 375 | } while (0) |
376 | 376 | |
377 | 377 | get_resource(plane, Plane, plane_id); |
378 | 378 | get_resource(crtc, Crtc, drm.crtc_id); |
379 | 379 | get_resource(connector, Connector, drm.connector_id); |
380 | 380 | |
381 | #define get_properties(type, TYPE, id) do { \ | |
382 | uint32_t i; \ | |
383 | drm.type->props = drmModeObjectGetProperties(drm.fd, \ | |
384 | id, DRM_MODE_OBJECT_##TYPE); \ | |
385 | if (!drm.type->props) { \ | |
386 | printf("could not get %s %u properties: %s\n", \ | |
387 | #type, id, strerror(errno)); \ | |
388 | return NULL; \ | |
389 | } \ | |
390 | drm.type->props_info = calloc(drm.type->props->count_props, \ | |
391 | sizeof(drm.type->props_info)); \ | |
392 | for (i = 0; i < drm.type->props->count_props; i++) { \ | |
393 | drm.type->props_info[i] = drmModeGetProperty(drm.fd,\ | |
394 | drm.type->props->props[i]); \ | |
395 | } \ | |
381 | #define get_properties(type, TYPE, id) do { \ | |
382 | uint32_t i; \ | |
383 | drm.type->props = drmModeObjectGetProperties(drm.fd, \ | |
384 | id, DRM_MODE_OBJECT_##TYPE); \ | |
385 | if (!drm.type->props) { \ | |
386 | printf("could not get %s %u properties: %s\n", \ | |
387 | #type, id, strerror(errno)); \ | |
388 | return NULL; \ | |
389 | } \ | |
390 | drm.type->props_info = calloc(drm.type->props->count_props, \ | |
391 | sizeof(drm.type->props_info)); \ | |
392 | for (i = 0; i < drm.type->props->count_props; i++) { \ | |
393 | drm.type->props_info[i] = drmModeGetProperty(drm.fd, \ | |
394 | drm.type->props->props[i]); \ | |
395 | } \ | |
396 | 396 | } while (0) |
397 | ||
398 | 397 | |
399 | 398 | get_properties(plane, PLANE, plane_id); |
400 | 399 | get_properties(crtc, CRTC, drm.crtc_id); |