#include <sys/ioctl.h>
#include <stdio.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xf86drmMode.h"
#include "xf86drm.h"
#include <drm.h>
#include <unistd.h>
#include <errno.h>
+#ifdef HAVE_VALGRIND
+#include <valgrind.h>
+#include <memcheck.h>
+#define VG(x) x
+#else
+#define VG(x)
+#endif
+
+#define VG_CLEAR(s) VG(memset(&s, 0, sizeof(s)))
+
#define U642VOID(x) ((void *)(unsigned long)(x))
#define VOID2U64(x) ((uint64_t)(unsigned long)(x))
struct drm_mode_fb_cmd f;
int ret;
+ VG_CLEAR(f);
f.width = width;
f.height = height;
f.pitch = pitch;
struct drm_mode_crtc crtc;
drmModeCrtcPtr r;
+ VG_CLEAR(crtc);
crtc.crtc_id = crtcId;
if (drmIoctl(fd, DRM_IOCTL_MODE_GETCRTC, &crtc))
{
struct drm_mode_crtc crtc;
+ VG_CLEAR(crtc);
crtc.x = x;
crtc.y = y;
crtc.crtc_id = crtcId;
drmModeEncoderPtr r = NULL;
enc.encoder_id = encoder_id;
+ enc.crtc_id = 0;
enc.encoder_type = 0;
enc.possible_crtcs = 0;
enc.possible_clones = 0;
struct drm_mode_get_property prop;
drmModePropertyPtr r;
+ VG_CLEAR(prop);
prop.prop_id = property_id;
prop.count_enum_blobs = 0;
prop.count_values = 0;