Skip to content

Commit

Permalink
Shutdown gradually if not able to initialize display
Browse files Browse the repository at this point in the history
  • Loading branch information
seriyps committed Oct 3, 2024
1 parent 4579eda commit e1c4c3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ int modeset_prepare(int fd, struct modeset_output *output_list, uint16_t mode_wi

*output_list = *out;
}
if (!output_list) {
if (!out) {
fprintf(stderr, "couldn't create any outputs\n");
return -1;
}
Expand Down
6 changes: 5 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,11 @@ int main(int argc, char **argv)
assert(drm_fd >= 0);
output_list = (struct modeset_output *)malloc(sizeof(struct modeset_output));
ret = modeset_prepare(drm_fd, output_list, mode_width, mode_height, mode_vrefresh);
assert(!ret);
if (ret) {
fprintf(stderr,
"cannot initialize display. Is display connected? Is --screen-mode correct?\n");
return -2;
}

////////////////////////////////// MPI SETUP
MppPacket packet;
Expand Down

0 comments on commit e1c4c3f

Please sign in to comment.