Lines Matching refs:mode

64 get_combine_mode(display_mode& mode)
66 if ((mode.flags & B_SCROLL) == 0)
69 if (mode.virtual_width == mode.timing.h_display * 2)
72 if (mode.virtual_height == mode.timing.v_display * 2)
80 get_refresh_rate(display_mode& mode)
84 return rint(10 * float(mode.timing.pixel_clock * 1000)
85 / float(mode.timing.h_total * mode.timing.v_total)) / 10.0;
163 screen_mode::SetTo(display_mode& mode)
165 width = mode.virtual_width;
166 height = mode.virtual_height;
167 space = (color_space)mode.space;
168 combine = get_combine_mode(mode);
169 refresh = get_refresh_rate(mode);
209 ScreenMode::Set(const screen_mode& mode, int32 workspace)
220 SetSwapDisplays(&screen, mode.swap_displays);
221 SetUseLaptopPanel(&screen, mode.use_laptop_panel);
222 SetTVStandard(&screen, mode.tv_standard);
225 if (!_GetDisplayMode(mode, displayMode))
233 ScreenMode::Get(screen_mode& mode, int32 workspace) const
244 mode.SetTo(displayMode);
247 if (GetSwapDisplays(&screen, &mode.swap_displays) != B_OK)
248 mode.swap_displays = false;
249 if (GetUseLaptopPanel(&screen, &mode.use_laptop_panel) != B_OK)
250 mode.use_laptop_panel = false;
251 if (GetTVStandard(&screen, &mode.tv_standard) != B_OK)
252 mode.tv_standard = 0;
259 ScreenMode::GetOriginalMode(screen_mode& mode, int32 workspace) const
267 mode = fOriginal[workspace];
274 ScreenMode::Set(const display_mode& mode, int32 workspace)
286 memcpy(&nonConstMode, &mode, sizeof(display_mode));
292 ScreenMode::Get(display_mode& mode, int32 workspace) const
299 return screen.GetMode(workspace, &mode);
352 ScreenMode::SupportsColorSpace(const screen_mode& mode, color_space space)
359 ScreenMode::GetRefreshLimits(const screen_mode& mode, float& min, float& max)
363 if (!_GetDisplayMode(mode, displayMode))
451 screen_mode mode;
452 mode.SetTo(fModeList[index]);
454 return mode;
477 /*! Searches for a similar mode in the reported mode list, and if that does not
478 find a matching mode, it will compute the mode manually using the GTF.
481 ScreenMode::_GetDisplayMode(const screen_mode& mode, display_mode& displayMode)
487 virtualWidth = mode.combine == kCombineHorizontally
488 ? mode.width * 2 : mode.width;
489 virtualHeight = mode.combine == kCombineVertically
490 ? mode.height * 2 : mode.height;
492 // try to find mode in list provided by driver
496 || (color_space)fModeList[i].space != mode.space)
499 // Accept the mode if the computed refresh rate of the mode is within
501 // refresh rates computed from mode parameters is not exact; especially
506 float refreshDiff = fabs(get_refresh_rate(fModeList[i]) - mode.refresh);
507 if (refreshDiff < 0.006 * mode.refresh) {
508 // Accept this mode.
513 // Since the computed refresh rate of the selected mode might differ
515 // 60.0), tweak the pixel clock so the the refresh rate of the mode
519 * displayMode.timing.v_total * mode.refresh) / 1000.0) + 0.5);
531 // we didn't find the exact mode, but something very similar?
539 // For the mode selected by the width, height, and refresh rate, compute
540 // the video timing parameters for the mode by using the VESA Generalized
542 compute_display_timing(mode.width, mode.height, mode.refresh, false,