Commit 2a2bb539 authored by Xaver Hugl's avatar Xaver Hugl
Browse files

backends/drm: explicitly initialize all fields of drmModeModeInfo


(cherry picked from commit f0d59b07)
parent 82a1538b
Pipeline #208392 passed with stage
in 28 minutes and 32 seconds
......@@ -445,20 +445,22 @@ QSharedPointer<DrmConnectorMode> DrmConnector::generateMode(const QSize &size, f
{
auto modeInfo = libxcvt_gen_mode_info(size.width(), size.height(), refreshRate, false, false);
drmModeModeInfo mode;
mode.vdisplay = modeInfo->vdisplay;
mode.hdisplay = modeInfo->hdisplay;
mode.clock = modeInfo->dot_clock;
mode.hsync_start = modeInfo->hsync_start;
mode.hsync_end = modeInfo->hsync_end;
mode.htotal = modeInfo->htotal;
mode.vsync_start = modeInfo->vsync_start;
mode.vsync_end = modeInfo->vsync_end;
mode.vtotal = modeInfo->vtotal;
mode.vrefresh = modeInfo->vrefresh;
mode.flags = modeInfo->mode_flags;
mode.type = DRM_MODE_TYPE_USERDEF;
drmModeModeInfo mode{
.clock = uint32_t(modeInfo->dot_clock),
.hdisplay = uint16_t(modeInfo->hdisplay),
.hsync_start = modeInfo->hsync_start,
.hsync_end = modeInfo->hsync_end,
.htotal = modeInfo->htotal,
.vdisplay = uint16_t(modeInfo->vdisplay),
.vsync_start = modeInfo->vsync_start,
.vsync_end = modeInfo->vsync_end,
.vtotal = modeInfo->vtotal,
.vscan = 1,
.vrefresh = uint32_t(modeInfo->vrefresh),
.flags = modeInfo->mode_flags,
.type = DRM_MODE_TYPE_USERDEF,
};
sprintf(mode.name, "%dx%d@%d", size.width(), size.height(), mode.vrefresh);
free(modeInfo);
......
Supports Markdown
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