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

« back to all changes in this revision

Viewing changes to video/efi_gop.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:
93
93
 
94
94
      total_mask = in->pixel_bitmask.r | in->pixel_bitmask.g
95
95
        | in->pixel_bitmask.b | in->pixel_bitmask.a;
96
 
        
 
96
 
97
97
      for (i = 31; i >= 0; i--)
98
98
        if (total_mask & (1 << i))
99
99
          return i + 1;
123
123
    if (!(mask & (1 << i)))
124
124
      break;
125
125
  *field_pos = i + 1;
126
 
  *mask_size = last_p - *field_pos;
 
126
  *mask_size = last_p - *field_pos + 1;
127
127
}
128
128
 
129
129
static grub_err_t
137
137
  out->bpp = grub_video_gop_get_bpp (in);
138
138
  out->bytes_per_pixel = out->bpp >> 3;
139
139
  if (!out->bpp)
140
 
    return grub_error (GRUB_ERR_IO, "Unsupported video mode");
 
140
    return grub_error (GRUB_ERR_IO, "unsupported video mode");
141
141
  out->pitch = in->pixels_per_scanline * out->bytes_per_pixel;
142
142
 
143
143
  switch (in->pixel_format)
176
176
      break;
177
177
 
178
178
    default:
179
 
      return grub_error (GRUB_ERR_IO, "Unsupported video mode");
 
179
      return grub_error (GRUB_ERR_IO, "unsupported video mode");
180
180
    }
181
181
 
182
182
  out->blit_format = grub_video_get_blit_format (out);
212
212
          found = 1;
213
213
        }
214
214
    }
215
 
  
 
215
 
216
216
  if (!found)
217
217
    {
218
218
      unsigned mode;
221
221
        {
222
222
          grub_efi_uintn_t size;
223
223
          grub_efi_status_t status;
224
 
          
 
224
         
225
225
          status = efi_call_4 (gop->query_mode, gop, mode, &size, &info);
226
226
          if (status)
227
227
            {
255
255
              * ((unsigned long long) bpp))
256
256
            {
257
257
              best_volume = ((unsigned long long) info->width)
258
 
                * ((unsigned long long) info->height) 
 
258
                * ((unsigned long long) info->height)
259
259
                * ((unsigned long long) bpp);
260
260
              best_mode = mode;
261
261
            }
266
266
  if (!found)
267
267
    {
268
268
      grub_dprintf ("video", "GOP: no mode found\n");
269
 
      return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no matching mode found.");
 
269
      return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no matching mode found");
270
270
    }
271
271
 
272
272
  if (best_mode != gop->mode->mode)
293
293
  grub_dprintf ("video", "GOP: initialising FB @ %p %dx%dx%d\n",
294
294
                framebuffer.ptr, framebuffer.mode_info.width,
295
295
                framebuffer.mode_info.height, framebuffer.mode_info.bpp);
296
 
  
297
 
  err = grub_video_fb_create_render_target_from_pointer 
 
296
 
 
297
  err = grub_video_fb_create_render_target_from_pointer
298
298
    (&framebuffer.render_target, &framebuffer.mode_info, framebuffer.ptr);
299
299
 
300
300
  if (err)
302
302
      grub_dprintf ("video", "GOP: Couldn't create FB target\n");
303
303
      return err;
304
304
    }
305
 
  
 
305
 
306
306
  err = grub_video_fb_set_active_render_target (framebuffer.render_target);
307
 
  
 
307
 
308
308
  if (err)
309
309
    {
310
310
      grub_dprintf ("video", "GOP: Couldn't set FB target\n");
311
311
      return err;
312
312
    }
313
 
  
 
313
 
314
314
  err = grub_video_fb_set_palette (0, GRUB_VIDEO_FBSTD_NUMCOLORS,
315
315
                                   grub_video_fbstd_colors);
316
316
 
318
318
    grub_dprintf ("video", "GOP: Couldn't set palette\n");
319
319
  else
320
320
    grub_dprintf ("video", "GOP: Success\n");
321
 
  
 
321
 
322
322
  return err;
323
323
}
324
324