~darkmuggle-deactivatedaccount/ubuntu/quantal/grub2/fix-872244

« back to all changes in this revision

Viewing changes to video/video.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2010-01-11 11:12:55 UTC
  • mfrom: (17.3.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100111111255-lr8ebkqw5x41gq6j
Tags: 1.98~20100101-1ubuntu1
* Resynchronise with Debian. Remaining changes:
  - Adjust for default Ubuntu boot options ("quiet splash").
  - Default to hiding the menu; holding down Shift at boot will show it.
  - Set a monochromatic theme for Ubuntu.
  - Apply Ubuntu GRUB Legacy changes to legacy update-grub script: title,
    recovery mode, quiet option, tweak how memtest86+ is displayed, and
    use UUIDs where appropriate.
  - Conflict with grub (<< 0.97-54) as well as grub-legacy.
  - Fix backslash-escaping in merge_debconf_into_conf.
  - Remove "GNU/Linux" from default distributor string.
  - Add crashkernel= options if kdump and makedumpfile are available.
  - If other operating systems are installed, then automatically unhide
    the menu. Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus
    if available to check whether Shift is pressed. If it is, show the
    menu, otherwise boot immediately. If keystatus is not available, then
    fall back to a short delay interruptible with Escape.
  - Allow Shift to interrupt 'sleep --interruptible'.
  - Don't display introductory message about line editing unless we're
    actually offering a shell prompt. Don't clear the screen just before
    booting if we never drew the menu in the first place.
  - Remove some verbose messages printed before reading the configuration
    file.
  - If the environment variable "quiet" is set to something other than 0,
    suppress progress messages as the kernel and initrd load. Set this for
    non-recovery kernel menu entries.
  - Add GRUB_DEFAULT=saved, as well as grub-set-default and grub-reboot
    utilities. Provides functionality essentially equivalent to GRUB
    Legacy's savedefault.
  - Keep the loopback file open so that subsequent changes to the "root"
    environment variable don't affect it.
  - Change prepare_grub_to_access_device to handle filesystems
    loop-mounted on file images.
  - Ignore devices loop-mounted from files in 10_linux.
  - Show the boot menu if the previous boot failed, that is if it failed
    to get to the end of one of the normal runlevels.
  - Handle RAID devices containing virtio components.
* Update savedefault patch from current Bazaar branch, fixing grub-reboot
  to have distinct behaviour from grub-set-default (LP: #497326).
* Fix grub-mkisofs compilation error with FORTIFY_SOURCE.
* Convert recordfail boilerplate in each menu entry to use a function.

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
grub_video_get_info (struct grub_video_mode_info *mode_info)
82
82
{
83
83
  if (! grub_video_adapter_active)
84
 
    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
 
84
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");
85
85
 
86
86
  /* If mode_info is NULL just report that video adapter is active.  */
87
87
  if (! mode_info)
101
101
  grub_err_t err;
102
102
 
103
103
  if (! grub_video_adapter_active)
104
 
    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
 
104
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");
105
105
 
106
106
  err = grub_video_adapter_active->get_info_and_fini (mode_info, framebuffer);
107
107
  if (err)
209
209
                        struct grub_video_palette_data *palette_data)
210
210
{
211
211
  if (! grub_video_adapter_active)
212
 
    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
 
212
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");
213
213
 
214
214
  return grub_video_adapter_active->set_palette (start, count, palette_data);
215
215
}
220
220
                        struct grub_video_palette_data *palette_data)
221
221
{
222
222
  if (! grub_video_adapter_active)
223
 
    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
 
223
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");
224
224
 
225
225
  return grub_video_adapter_active->get_palette (start, count, palette_data);
226
226
}
231
231
                         unsigned int width, unsigned int height)
232
232
{
233
233
  if (! grub_video_adapter_active)
234
 
    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
 
234
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");
235
235
 
236
236
  return grub_video_adapter_active->set_viewport (x, y, width, height);
237
237
}
242
242
                         unsigned int *width, unsigned int *height)
243
243
{
244
244
  if (! grub_video_adapter_active)
245
 
    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
 
245
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");
246
246
 
247
247
  return grub_video_adapter_active->get_viewport (x, y, width, height);
248
248
}
285
285
                        grub_uint8_t *alpha)
286
286
{
287
287
  if (! grub_video_adapter_active)
288
 
    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
 
288
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");
289
289
 
290
290
  return grub_video_adapter_active->unmap_color (color,
291
291
                                                 red,
300
300
                      unsigned int width, unsigned int height)
301
301
{
302
302
  if (! grub_video_adapter_active)
303
 
    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
 
303
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");
304
304
 
305
305
  return grub_video_adapter_active->fill_rect (color, x, y, width, height);
306
306
}
313
313
                        unsigned int width, unsigned int height)
314
314
{
315
315
  if (! grub_video_adapter_active)
316
 
    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
 
316
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");
317
317
 
318
318
  return grub_video_adapter_active->blit_bitmap (bitmap, oper, x, y,
319
319
                                                 offset_x, offset_y,
328
328
                               unsigned int width, unsigned int height)
329
329
{
330
330
  if (! grub_video_adapter_active)
331
 
    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
 
331
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");
332
332
 
333
333
  return grub_video_adapter_active->blit_render_target (target, oper, x, y,
334
334
                                                        offset_x, offset_y,
340
340
grub_video_scroll (grub_video_color_t color, int dx, int dy)
341
341
{
342
342
  if (! grub_video_adapter_active)
343
 
    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
 
343
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");
344
344
 
345
345
  return grub_video_adapter_active->scroll (color, dx, dy);
346
346
}
350
350
grub_video_swap_buffers (void)
351
351
{
352
352
  if (! grub_video_adapter_active)
353
 
    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
 
353
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");
354
354
 
355
355
  return grub_video_adapter_active->swap_buffers ();
356
356
}
362
362
                                 unsigned int mode_type)
363
363
{
364
364
  if (! grub_video_adapter_active)
365
 
    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
 
365
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");
366
366
 
367
367
  return grub_video_adapter_active->create_render_target (result,
368
368
                                                          width, height,
374
374
grub_video_delete_render_target (struct grub_video_render_target *target)
375
375
{
376
376
  if (! grub_video_adapter_active)
377
 
    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
 
377
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");
378
378
 
379
379
  return grub_video_adapter_active->delete_render_target (target);
380
380
}
384
384
grub_video_set_active_render_target (struct grub_video_render_target *target)
385
385
{
386
386
  if (! grub_video_adapter_active)
387
 
    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
 
387
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");
388
388
 
389
389
  return grub_video_adapter_active->set_active_render_target (target);
390
390
}
394
394
grub_video_get_active_render_target (struct grub_video_render_target **target)
395
395
{
396
396
  if (! grub_video_adapter_active)
397
 
    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
 
397
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");
398
398
 
399
399
  return grub_video_adapter_active->get_active_render_target (target);
400
400
}
460
460
          grub_free (modevar);
461
461
 
462
462
          return grub_error (GRUB_ERR_BAD_ARGUMENT,
463
 
                             "No suitable mode found.");
 
463
                             "no suitable mode found");
464
464
        }
465
465
 
466
466
      /* Skip separator. */
545
545
 
546
546
          /* First setup error message.  */
547
547
          rc = grub_error (GRUB_ERR_BAD_ARGUMENT,
548
 
                           "Invalid mode: %s\n",
 
548
                           "invalid mode: %s",
549
549
                           current_mode);
550
550
 
551
551
          /* Free memory before returning.  */
564
564
 
565
565
          /* First setup error message.  */
566
566
          rc = grub_error (GRUB_ERR_BAD_ARGUMENT,
567
 
                           "Invalid mode: %s\n",
 
567
                           "invalid mode: %s",
568
568
                           current_mode);
569
569
 
570
570
          /* Free memory before returning.  */
585
585
 
586
586
              /* First setup error message.  */
587
587
              rc = grub_error (GRUB_ERR_BAD_ARGUMENT,
588
 
                               "Invalid mode: %s\n",
 
588
                               "invalid mode: %s",
589
589
                               current_mode);
590
590
 
591
591
              /* Free memory before returning.  */
607
607
 
608
608
              /* First setup error message.  */
609
609
              rc = grub_error (GRUB_ERR_BAD_ARGUMENT,
610
 
                               "Invalid mode: %s\n",
 
610
                               "invalid mode: %s",
611
611
                               current_mode);
612
612
 
613
613
              /* Free memory before returning.  */
625
625
 
626
626
              /* First setup error message.  */
627
627
              rc = grub_error (GRUB_ERR_BAD_ARGUMENT,
628
 
                               "Invalid mode: %s\n",
 
628
                               "invalid mode: %s",
629
629
                               current_mode);
630
630
 
631
631
              /* Free memory before returning.  */
709
709
  grub_free (modevar);
710
710
 
711
711
  return grub_error (GRUB_ERR_BAD_ARGUMENT,
712
 
                     "No suitable mode found.");
 
712
                     "no suitable mode found");
713
713
}
714
714
 
715
715
/* Initialize Video API module.  */