diff options
author | Naoto Yamaguchi <naoto.yamaguchi@aisin.co.jp> | 2023-04-23 20:25:45 +0900 |
---|---|---|
committer | Naoto Yamaguchi <naoto.yamaguchi@aisin.co.jp> | 2023-05-09 08:13:10 +0900 |
commit | b3e49987c5706612ee342c685dea799be596df6a (patch) | |
tree | 7c4e724755638a387fa7bf555e050f59be81fbbe /meta-agl-drm-lease/recipes-core/psplash/files/0003-Fix-unused-result-warnings.patch | |
parent | a070ad4db8e4a35fc34b0610b56dcfc1e2caaad3 (diff) |
Enable drm-lease support at psplash
The upstream version of psplash is supporting fb based splash screen.
On the other hand, drm lease infrastructure is not support fb.
This patch enable drm-lease support at psplash.
This work contributed by Hiroyuki Ishii at CES2023 demo development.
Bug-AGL: SPEC-4766
Change-Id: I50b382c7f8ca4b46a8fb06fd649d0cfa49800c6d
Signed-off-by: Naoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>
Diffstat (limited to 'meta-agl-drm-lease/recipes-core/psplash/files/0003-Fix-unused-result-warnings.patch')
-rw-r--r-- | meta-agl-drm-lease/recipes-core/psplash/files/0003-Fix-unused-result-warnings.patch | 150 |
1 files changed, 150 insertions, 0 deletions
diff --git a/meta-agl-drm-lease/recipes-core/psplash/files/0003-Fix-unused-result-warnings.patch b/meta-agl-drm-lease/recipes-core/psplash/files/0003-Fix-unused-result-warnings.patch new file mode 100644 index 00000000..948609d9 --- /dev/null +++ b/meta-agl-drm-lease/recipes-core/psplash/files/0003-Fix-unused-result-warnings.patch @@ -0,0 +1,150 @@ +From edb01af9b4789b9c3b908329f6be5819e2cfe954 Mon Sep 17 00:00:00 2001 +From: Vasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com> +Date: Mon, 25 Apr 2022 10:59:42 +0300 +Subject: [PATCH 03/17] Fix 'unused-result' warnings + +This fixes warnings such as: + + ignoring return value of 'chdir', declared with attribute warn_unused_result [-Wunused-result] + +drm-backend backport from: +https://patchwork.yoctoproject.org/project/yocto/cover/20220425075954.10427-1-vasyl.vavrychuk@opensynergy.com/ + +Signed-off-by: Vasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com> +--- + psplash-systemd.c | 36 +++++++++++++++++++++++++++++++++--- + psplash-write.c | 23 ++++++++++++++++++----- + psplash.c | 5 ++++- + 3 files changed, 55 insertions(+), 9 deletions(-) + +diff --git a/psplash-systemd.c b/psplash-systemd.c +index 840bd4e..dcf7e61 100644 +--- a/psplash-systemd.c ++++ b/psplash-systemd.c +@@ -32,6 +32,7 @@ int get_progress(void) + int r; + char buffer[20]; + int len; ++ ssize_t written; + + /* Connect to the system bus */ + r = sd_bus_new(&bus); +@@ -71,11 +72,36 @@ int get_progress(void) + current_progress = progress; + + len = snprintf(buffer, 20, "PROGRESS %d", (int)(current_progress * 100)); +- write(pipe_fd, buffer, len + 1); ++ written = write(pipe_fd, buffer, len + 1); ++ if (written == -1) { ++ /* EPIPE could mean that psplash detected boot complete sooner ++ then psplash-systemd and exited */ ++ if (errno != EPIPE) { ++ perror("write"); ++ r = -1; ++ goto finish; ++ } ++ } else if (written < len + 1) { ++ fprintf(stderr, "Wrote %zd bytes, less then expected %d bytes\n", ++ written, len + 1); ++ r = -1; ++ goto finish; ++ } + + if (progress == 1.0) { + printf("Systemd reported progress of 1.0, quit psplash.\n"); +- write(pipe_fd, "QUIT", 5); ++ written = write(pipe_fd, "QUIT", 5); ++ if (written == -1) { ++ /* EPIPE could mean that psplash detected boot complete ++ sooner then psplash-systemd and exited */ ++ if (errno != EPIPE) { ++ perror("write"); ++ r = -1; ++ goto finish; ++ } ++ } else if (written < 5) ++ fprintf(stderr, "Wrote %zd bytes, less then expected 5 bytes\n", ++ written); + r = -1; + } + +@@ -123,7 +149,11 @@ int main() + if (!rundir) + rundir = "/run"; + +- chdir(rundir); ++ r = chdir(rundir); ++ if (r < 0) { ++ perror("chdir"); ++ goto finish; ++ } + + if ((pipe_fd = open (PSPLASH_FIFO,O_WRONLY|O_NONBLOCK)) == -1) { + fprintf(stderr, "Error unable to open fifo"); +diff --git a/psplash-write.c b/psplash-write.c +index eee0ea3..16b87e1 100644 +--- a/psplash-write.c ++++ b/psplash-write.c +@@ -21,8 +21,10 @@ + + int main(int argc, char **argv) + { +- char *rundir; +- int pipe_fd; ++ char *rundir; ++ int pipe_fd; ++ size_t count; ++ ssize_t written; + + rundir = getenv("PSPLASH_FIFO_DIR"); + +@@ -35,7 +37,10 @@ int main(int argc, char **argv) + exit(-1); + } + +- chdir(rundir); ++ if (chdir(rundir)) { ++ perror("chdir"); ++ exit(-1); ++ } + + if ((pipe_fd = open (PSPLASH_FIFO,O_WRONLY|O_NONBLOCK)) == -1) + { +@@ -45,8 +50,16 @@ int main(int argc, char **argv) + exit (-1); + } + +- write(pipe_fd, argv[1], strlen(argv[1])+1); ++ count = strlen(argv[1]) + 1; ++ written = write(pipe_fd, argv[1], count); ++ if (written == -1) { ++ perror("write"); ++ exit(-1); ++ } else if ((size_t)written < count) { ++ fprintf(stderr, "Wrote %zd bytes, less then expected %zu bytes\n", ++ written, count); ++ exit(-1); ++ } + + return 0; + } +- +diff --git a/psplash.c b/psplash.c +index 838ac13..62244ba 100644 +--- a/psplash.c ++++ b/psplash.c +@@ -264,7 +264,10 @@ main (int argc, char** argv) + if (!rundir) + rundir = "/run"; + +- chdir(rundir); ++ if (chdir(rundir)) { ++ perror("chdir"); ++ exit(-1); ++ } + + if (mkfifo(PSPLASH_FIFO, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP)) + { +-- +2.25.1 + |