Skip to content

Commit

Permalink
Shutdown gradually if not able to initialize display (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
seriyps authored Oct 4, 2024
1 parent d6b1ae2 commit e070b64
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 @@ -685,7 +685,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

3 comments on commit e070b64

@JohnDGodwin
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit causes PixelPilot to not launch on the Orange Pi 5 Plus, I suspect is has something to do with the dual hdmi ports.

@seriyps
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that's unfortunate. I might have an idea how to fix that, but I don't have any dual-hdmi device to test. May I send you the changes needed so you can verify that it works?

@seriyps
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JohnDGodwin should be addressed in #19

Please sign in to comment.