summaryrefslogtreecommitdiffstats
path: root/meta-agl-drm-lease/recipes-core/psplash/files/0002-Trim-trailing-spaces.patch
blob: 2980809e9d9d5e3822367e041bfddd9fd4f654cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
From 5f82ef966776c9520af8ca59d12260d7e908e464 Mon Sep 17 00:00:00 2001
From: Vasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com>
Date: Mon, 25 Apr 2022 10:59:41 +0300
Subject: [PATCH 02/17] Trim trailing spaces

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-console.c | 34 +++++++++++-----------
 psplash-console.h |  8 ++---
 psplash-fb.c      |  4 +--
 psplash-fb.h      | 34 +++++++++++-----------
 psplash-write.c   | 14 ++++-----
 psplash.c         | 74 +++++++++++++++++++++++------------------------
 psplash.h         |  4 +--
 7 files changed, 86 insertions(+), 86 deletions(-)

diff --git a/psplash-console.c b/psplash-console.c
index 3a40620..c00c6fe 100644
--- a/psplash-console.c
+++ b/psplash-console.c
@@ -1,5 +1,5 @@
-/* 
- *  pslash - a lightweight framebuffer splashscreen for embedded devices. 
+/*
+ *  pslash - a lightweight framebuffer splashscreen for embedded devices.
  *
  *  Copyright (c) 2006 Matthew Allum <mallum@o-hand.com>
  *
@@ -27,12 +27,12 @@ vt_request (int UNUSED(sig))
 	perror("Error cannot switch away from console");
       Visible = 0;
 
-      /* FIXME: 
-       * We likely now want to signal the main loop as to exit	 
+      /* FIXME:
+       * We likely now want to signal the main loop as to exit
        * and we've now likely switched to the X tty. Note, this
        * seems to happen anyway atm due to select() call getting
        * a signal interuption error - not sure if this is really
-       * reliable however. 
+       * reliable however.
       */
     }
   else
@@ -49,7 +49,7 @@ psplash_console_ignore_switches (void)
 {
   struct sigaction    act;
   struct vt_mode      vt_mode;
-  
+
   if (ioctl(ConsoleFd, VT_GETMODE, &vt_mode) < 0)
     {
       perror("Error VT_SETMODE failed");
@@ -60,7 +60,7 @@ psplash_console_ignore_switches (void)
   sigemptyset (&act.sa_mask);
   act.sa_flags = 0;
   sigaction (SIGUSR1, &act, 0);
-  
+
   vt_mode.mode = VT_AUTO;
   vt_mode.relsig = 0;
   vt_mode.acqsig = 0;
@@ -74,7 +74,7 @@ psplash_console_handle_switches (void)
 {
   struct sigaction    act;
   struct vt_mode      vt_mode;
- 
+
   if (ioctl(ConsoleFd, VT_GETMODE, &vt_mode) < 0)
     {
       perror("Error VT_SETMODE failed");
@@ -85,7 +85,7 @@ psplash_console_handle_switches (void)
   sigemptyset (&act.sa_mask);
   act.sa_flags = 0;
   sigaction (SIGUSR1, &act, 0);
-  
+
   vt_mode.mode   = VT_PROCESS;
   vt_mode.relsig = SIGUSR1;
   vt_mode.acqsig = SIGUSR1;
@@ -94,8 +94,8 @@ psplash_console_handle_switches (void)
     perror("Error VT_SETMODE failed");
 }
 
-void 
-psplash_console_switch (void) 
+void
+psplash_console_switch (void)
 {
   char           vtname[10];
   int            fd;
@@ -114,9 +114,9 @@ psplash_console_switch (void)
       close(fd);
       return;
     }
-  
+
   close(fd);
-  
+
   sprintf(vtname,"/dev/tty%d", VTNum);
 
   if ((ConsoleFd = open(vtname, O_RDWR|O_NDELAY, 0)) < 0)
@@ -134,12 +134,12 @@ psplash_console_switch (void)
 
   if (ioctl(ConsoleFd, VT_ACTIVATE, VTNum) != 0)
     perror("Error VT_ACTIVATE failed");
-  
+
   if (ioctl(ConsoleFd, VT_WAITACTIVE, VTNum) != 0)
     perror("Error VT_WAITACTIVE failed\n");
 
   psplash_console_handle_switches ();
-  
+
   if (ioctl(ConsoleFd, KDSETMODE, KD_GRAPHICS) < 0)
     perror("Error KDSETMODE KD_GRAPHICS failed\n");
 
@@ -156,7 +156,7 @@ psplash_console_reset (void)
     return;
 
   /* Back to text mode */
-  ioctl(ConsoleFd, KDSETMODE, KD_TEXT); 
+  ioctl(ConsoleFd, KDSETMODE, KD_TEXT);
 
   psplash_console_ignore_switches ();
 
@@ -175,7 +175,7 @@ psplash_console_reset (void)
 
   /* Cleanup */
 
-  close(ConsoleFd); 
+  close(ConsoleFd);
 
   if ((fd = open ("/dev/tty0", O_RDWR|O_NDELAY, 0)) >= 0)
     {
diff --git a/psplash-console.h b/psplash-console.h
index c893bf2..ad51ef2 100644
--- a/psplash-console.h
+++ b/psplash-console.h
@@ -1,5 +1,5 @@
-/* 
- *  pslash - a lightweight framebuffer splashscreen for embedded devices. 
+/*
+ *  pslash - a lightweight framebuffer splashscreen for embedded devices.
  *
  *  Copyright (c) 2006 Matthew Allum <mallum@o-hand.com>
  *
@@ -10,8 +10,8 @@
 #ifndef _HAVE_PSPLASH_CONSOLE_H
 #define _HAVE_PSPLASH_CONSOLE_H
 
-void 
-psplash_console_switch (void); 
+void
+psplash_console_switch (void);
 
 void
 psplash_console_reset (void);
diff --git a/psplash-fb.c b/psplash-fb.c
index 2babb5f..1d2d7db 100644
--- a/psplash-fb.c
+++ b/psplash-fb.c
@@ -429,13 +429,13 @@ psplash_fb_plot_pixel (PSplashFB    *fb,
       {
       case 32:
         *(volatile uint32_t *) (fb->bdata + off)
-	  = ((red >> (8 - fb->red_length)) << fb->red_offset) 
+	  = ((red >> (8 - fb->red_length)) << fb->red_offset)
 	      | ((green >> (8 - fb->green_length)) << fb->green_offset)
 	      | ((blue >> (8 - fb->blue_length)) << fb->blue_offset);
         break;
       case 16:
         *(volatile uint16_t *) (fb->bdata + off)
-	  = ((red >> (8 - fb->red_length)) << fb->red_offset) 
+	  = ((red >> (8 - fb->red_length)) << fb->red_offset)
 	      | ((green >> (8 - fb->green_length)) << fb->green_offset)
 	      | ((blue >> (8 - fb->blue_length)) << fb->blue_offset);
         break;
diff --git a/psplash-fb.h b/psplash-fb.h
index 16e2b20..eafa293 100644
--- a/psplash-fb.h
+++ b/psplash-fb.h
@@ -1,5 +1,5 @@
-/* 
- *  pslash - a lightweight framebuffer splashscreen for embedded devices. 
+/*
+ *  pslash - a lightweight framebuffer splashscreen for embedded devices.
  *
  *  Copyright (c) 2006 Matthew Allum <mallum@o-hand.com>
  *
@@ -20,11 +20,11 @@ enum RGBMode {
 
 typedef struct PSplashFB
 {
-  int            fd;			
+  int            fd;
   struct fb_var_screeninfo fb_var;
-  struct termios save_termios;	        
-  int            type;		        
-  int            visual;		
+  struct termios save_termios;
+  int            type;
+  int            visual;
   int            width, height;
   int            bpp;
   int            stride;
@@ -56,20 +56,20 @@ PSplashFB*
 psplash_fb_new (int angle, int fbdev_id);
 
 void
-psplash_fb_draw_rect (PSplashFB    *fb, 
-		      int          x, 
-		      int          y, 
-		      int          width, 
+psplash_fb_draw_rect (PSplashFB    *fb,
+		      int          x,
+		      int          y,
+		      int          width,
 		      int          height,
 		      uint8        red,
 		      uint8        green,
 		      uint8        blue);
 
 void
-psplash_fb_draw_image (PSplashFB    *fb, 
-		       int          x, 
-		       int          y, 
-		       int          img_width, 
+psplash_fb_draw_image (PSplashFB    *fb,
+		       int          x,
+		       int          y,
+		       int          img_width,
 		       int          img_height,
 		       int          img_bytes_pre_pixel,
 		       int          img_rowstride,
@@ -82,9 +82,9 @@ psplash_fb_text_size (int                *width,
 		      const char         *text);
 
 void
-psplash_fb_draw_text (PSplashFB         *fb, 
-		      int                x, 
-		      int                y, 
+psplash_fb_draw_text (PSplashFB         *fb,
+		      int                x,
+		      int                y,
 		      uint8              red,
 		      uint8              green,
 		      uint8              blue,
diff --git a/psplash-write.c b/psplash-write.c
index a12467a..eee0ea3 100644
--- a/psplash-write.c
+++ b/psplash-write.c
@@ -1,5 +1,5 @@
-/* 
- *  pslash - a lightweight framebuffer splashscreen for embedded devices. 
+/*
+ *  pslash - a lightweight framebuffer splashscreen for embedded devices.
  *
  *  Copyright (c) 2006 Matthew Allum <mallum@o-hand.com>
  *
@@ -19,7 +19,7 @@
 #include <errno.h>
 #include "psplash.h"
 
-int main(int argc, char **argv) 
+int main(int argc, char **argv)
 {
   char *rundir;
   int   pipe_fd;
@@ -29,17 +29,17 @@ int main(int argc, char **argv)
   if (!rundir)
     rundir = "/run";
 
-  if (argc!=2) 
+  if (argc!=2)
     {
       fprintf(stderr, "Wrong number of arguments\n");
       exit(-1);
     }
-  
+
   chdir(rundir);
-  
+
   if ((pipe_fd = open (PSPLASH_FIFO,O_WRONLY|O_NONBLOCK)) == -1)
     {
-      /* Silently error out instead of covering the boot process in 
+      /* Silently error out instead of covering the boot process in
          errors when psplash has exitted due to a VC switch */
       /* perror("Error unable to open fifo"); */
       exit (-1);
diff --git a/psplash.c b/psplash.c
index ee1af6b..838ac13 100644
--- a/psplash.c
+++ b/psplash.c
@@ -1,9 +1,9 @@
-/* 
- *  pslash - a lightweight framebuffer splashscreen for embedded devices. 
+/*
+ *  pslash - a lightweight framebuffer splashscreen for embedded devices.
  *
  *  Copyright (c) 2006 Matthew Allum <mallum@o-hand.com>
  *
- *  Parts of this file ( fifo handling ) based on 'usplash' copyright 
+ *  Parts of this file ( fifo handling ) based on 'usplash' copyright
  *  Matthew Garret.
  *
  *  SPDX-License-Identifier: GPL-2.0-or-later
@@ -46,15 +46,15 @@ psplash_draw_msg (PSplashFB *fb, const char *msg)
 
   /* Clear */
 
-  psplash_fb_draw_rect (fb, 
-			0, 
-			SPLIT_LINE_POS(fb) - h, 
+  psplash_fb_draw_rect (fb,
+			0,
+			SPLIT_LINE_POS(fb) - h,
 			fb->width,
 			h,
 			PSPLASH_BACKGROUND_COLOR);
 
   psplash_fb_draw_text (fb,
-			(fb->width-w)/2, 
+			(fb->width-w)/2,
 			SPLIT_LINE_POS(fb) - h,
 			PSPLASH_TEXT_COLOR,
 			&FONT_DEF,
@@ -70,13 +70,13 @@ psplash_draw_progress (PSplashFB *fb, int value)
   /* 4 pix border */
   x      = ((fb->width  - BAR_IMG_WIDTH)/2) + 4 ;
   y      = SPLIT_LINE_POS(fb) + 4;
-  width  = BAR_IMG_WIDTH - 8; 
+  width  = BAR_IMG_WIDTH - 8;
   height = BAR_IMG_HEIGHT - 8;
 
   if (value > 0)
     {
       barwidth = (CLAMP(value,0,100) * width) / 100;
-      psplash_fb_draw_rect (fb, x + barwidth, y, 
+      psplash_fb_draw_rect (fb, x + barwidth, y,
     			width - barwidth, height,
 			PSPLASH_BAR_BACKGROUND_COLOR);
       psplash_fb_draw_rect (fb, x, y, barwidth,
@@ -85,7 +85,7 @@ psplash_draw_progress (PSplashFB *fb, int value)
   else
     {
       barwidth = (CLAMP(-value,0,100) * width) / 100;
-      psplash_fb_draw_rect (fb, x, y, 
+      psplash_fb_draw_rect (fb, x, y,
     			width - barwidth, height,
 			PSPLASH_BAR_BACKGROUND_COLOR);
       psplash_fb_draw_rect (fb, x + width - barwidth,
@@ -93,18 +93,18 @@ psplash_draw_progress (PSplashFB *fb, int value)
 			    PSPLASH_BAR_COLOR);
     }
 
-  DBG("value: %i, width: %i, barwidth :%i\n", value, 
+  DBG("value: %i, width: %i, barwidth :%i\n", value,
 		width, barwidth);
 }
 #endif /* PSPLASH_SHOW_PROGRESS_BAR */
 
-static int 
+static int
 parse_command (PSplashFB *fb, char *string)
 {
   char *command;
 
   DBG("got cmd %s", string);
-	
+
   if (strcmp(string,"QUIT") == 0)
     return 1;
 
@@ -116,7 +116,7 @@ parse_command (PSplashFB *fb, char *string)
 
       if (arg)
         psplash_draw_msg (fb, arg);
-    } 
+    }
  #ifdef PSPLASH_SHOW_PROGRESS_BAR
   else  if (!strcmp(command,"PROGRESS"))
     {
@@ -124,9 +124,9 @@ parse_command (PSplashFB *fb, char *string)
 
       if (arg)
         psplash_draw_progress (fb, atoi(arg));
-    } 
+    }
 #endif
-  else if (!strcmp(command,"QUIT")) 
+  else if (!strcmp(command,"QUIT"))
     {
       return 1;
     }
@@ -135,8 +135,8 @@ parse_command (PSplashFB *fb, char *string)
   return 0;
 }
 
-void 
-psplash_main (PSplashFB *fb, int pipe_fd, int timeout) 
+void
+psplash_main (PSplashFB *fb, int pipe_fd, int timeout)
 {
   int            err;
   ssize_t        length = 0;
@@ -154,14 +154,14 @@ psplash_main (PSplashFB *fb, int pipe_fd, int timeout)
 
   end = command;
 
-  while (1) 
+  while (1)
     {
-      if (timeout != 0) 
+      if (timeout != 0)
 	err = select(pipe_fd+1, &descriptors, NULL, NULL, &tv);
       else
 	err = select(pipe_fd+1, &descriptors, NULL, NULL, NULL);
-      
-      if (err <= 0) 
+
+      if (err <= 0)
 	{
 	  /*
 	  if (errno == EINTR)
@@ -169,10 +169,10 @@ psplash_main (PSplashFB *fb, int pipe_fd, int timeout)
 	  */
 	  return;
 	}
-      
+
       length += read (pipe_fd, end, sizeof(command) - (end - command));
 
-      if (length == 0) 
+      if (length == 0)
 	{
 	  /* Reopen to see if there's anything more for us */
 	  close(pipe_fd);
@@ -208,10 +208,10 @@ psplash_main (PSplashFB *fb, int pipe_fd, int timeout)
 
     out:
       end = &command[length];
-    
+
       tv.tv_sec = timeout;
       tv.tv_usec = 0;
-      
+
       FD_ZERO(&descriptors);
       FD_SET(pipe_fd,&descriptors);
     }
@@ -219,8 +219,8 @@ psplash_main (PSplashFB *fb, int pipe_fd, int timeout)
   return;
 }
 
-int 
-main (int argc, char** argv) 
+int
+main (int argc, char** argv)
 {
   char      *rundir;
   int        pipe_fd, i = 0, angle = 0, fbdev_id = 0, ret = 0;
@@ -253,8 +253,8 @@ main (int argc, char** argv)
       }
 
     fail:
-      fprintf(stderr, 
-              "Usage: %s [-n|--no-console-switch][-a|--angle <0|90|180|270>][-f|--fbdev <0..9>]\n", 
+      fprintf(stderr,
+              "Usage: %s [-n|--no-console-switch][-a|--angle <0|90|180|270>][-f|--fbdev <0..9>]\n",
               argv[0]);
       exit(-1);
   }
@@ -268,7 +268,7 @@ main (int argc, char** argv)
 
   if (mkfifo(PSPLASH_FIFO, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP))
     {
-      if (errno!=EEXIST) 
+      if (errno!=EEXIST)
 	    {
 	      perror("mkfifo");
 	      exit(-1);
@@ -276,8 +276,8 @@ main (int argc, char** argv)
     }
 
   pipe_fd = open (PSPLASH_FIFO,O_RDONLY|O_NONBLOCK);
-  
-  if (pipe_fd==-1) 
+
+  if (pipe_fd==-1)
     {
       perror("pipe open");
       exit(-2);
@@ -301,8 +301,8 @@ main (int argc, char** argv)
                         PSPLASH_BACKGROUND_COLOR);
 
   /* Draw the Poky logo  */
-  psplash_fb_draw_image (fb, 
-			 (fb->width  - POKY_IMG_WIDTH)/2, 
+  psplash_fb_draw_image (fb,
+			 (fb->width  - POKY_IMG_WIDTH)/2,
 #if PSPLASH_IMG_FULLSCREEN
 			 (fb->height - POKY_IMG_HEIGHT)/2,
 #else
@@ -317,8 +317,8 @@ main (int argc, char** argv)
 
 #ifdef PSPLASH_SHOW_PROGRESS_BAR
   /* Draw progress bar border */
-  psplash_fb_draw_image (fb, 
-			 (fb->width  - BAR_IMG_WIDTH)/2, 
+  psplash_fb_draw_image (fb,
+			 (fb->width  - BAR_IMG_WIDTH)/2,
 			 SPLIT_LINE_POS(fb),
 			 BAR_IMG_WIDTH,
 			 BAR_IMG_HEIGHT,
diff --git a/psplash.h b/psplash.h
index 9be44ba..e8b6660 100644
--- a/psplash.h
+++ b/psplash.h
@@ -1,5 +1,5 @@
-/* 
- *  pslash - a lightweight framebuffer splashscreen for embedded devices. 
+/*
+ *  pslash - a lightweight framebuffer splashscreen for embedded devices.
  *
  *  Copyright (c) 2006 Matthew Allum <mallum@o-hand.com>
  *
-- 
2.25.1