Lines Matching refs:mode

20 	// Search the mode list for the mode with specified width, height,
22 // function will search for a mode satisfying the other 3 arguments, and
23 // if more than one matching mode is found, the one with the greatest color
33 display_mode& mode = gInfo.modeList[j];
35 if (mode.timing.h_display == width && mode.timing.v_display == height) {
36 int modeRefreshRate = int(((mode.timing.pixel_clock * 1000.0 /
37 mode.timing.h_total) / mode.timing.v_total) + 0.5);
40 if (selectedMode == NULL || mode.space > selectedMode->space)
41 selectedMode = &mode;
43 if (mode.space == colorDepth)
44 return &mode;
56 IsThereEnoughFBMemory(const display_mode* mode, uint32 bitsPerPixel)
58 // Test if there is enough Frame Buffer memory for the mode and color depth
61 uint32 maxWidth = mode->virtual_width;
62 if (mode->timing.h_display > maxWidth)
63 maxWidth = mode->timing.h_display;
65 uint32 maxHeight = mode->virtual_height;
66 if (mode->timing.v_display > maxHeight)
67 maxHeight = mode->timing.v_display;
77 GetVesaModeNumber(const display_mode& mode, uint8 bitsPerPixel)
79 // Search VESA mode table for a matching mode, and return the VESA mode
89 if (vesaMode.width == mode.timing.h_display
90 && vesaMode.height == mode.timing.v_display
92 return vesaMode.mode;
95 return 0; // matching VESA mode not found
101 IsModeUsable(const display_mode* mode)
103 // Test if the display mode is usable by the current video chip. That is,
104 // does the chip have enough memory for the mode and is the pixel clock
107 // Return true if the mode is usable.
113 if (!gInfo.GetColorSpaceParams(mode->space, bitsPerPixel, maxPixelClock))
116 // Is there enough frame buffer memory to handle the mode?
118 if (!IsThereEnoughFBMemory(mode, bitsPerPixel))
122 // Test if mode is usable for a chip that is connected to a monitor
125 if (mode->timing.pixel_clock > maxPixelClock)
132 if (mode->space == uint32(si.colorSpaces[j])) {
144 if (mode->timing.h_display == 640 && mode->timing.v_display < 480)
147 // Test if mode is usable for a chip that is connected to a laptop LCD
151 // that resolution can not be set without a failure in the VESA set mode
154 if (si.chipType == MACH64_MOBILITY && mode->timing.h_display == 640
155 && mode->timing.v_display == 350)
158 // Search VESA mode table for matching mode.
160 if (GetVesaModeNumber(*mode, bitsPerPixel) == 0)
169 CreateModeList(bool (*checkMode)(const display_mode* mode))
173 // Obtain EDID info which is needed for for building the mode list.
237 // Search the mode list for the specified mode.
242 display_mode& mode = gInfo.modeList[j];
244 if (target->timing.h_display == mode.timing.h_display
245 && target->timing.v_display == mode.timing.v_display
246 && target->space == mode.space)
247 return B_OK; // mode found in list
250 return B_BAD_VALUE; // mode not found in list
257 // First validate the mode, then call a function to set the registers.
262 DisplayModeEx mode;
263 (display_mode&)mode = *pMode;
266 if ( ! gInfo.GetColorSpaceParams(mode.space, mode.bitsPerPixel, maxPixelClock))
269 if (ProposeDisplayMode(&mode, pMode, pMode) != B_OK)
272 int bytesPerPixel = (mode.bitsPerPixel + 7) / 8;
273 mode.bytesPerRow = mode.timing.h_display * bytesPerPixel;
275 // Is there enough frame buffer memory for this mode?
277 if ( ! IsThereEnoughFBMemory(&mode, mode.bitsPerPixel))
280 TRACE("Set display mode: %dx%d virtual size: %dx%d color depth: %d bits/pixel\n",
281 mode.timing.h_display, mode.timing.v_display,
282 mode.virtual_width, mode.virtual_height, mode.bitsPerPixel);
285 TRACE(" mode timing: %d %d %d %d %d %d %d %d %d\n",
286 mode.timing.pixel_clock,
287 mode.timing.h_display,
288 mode.timing.h_sync_start, mode.timing.h_sync_end,
289 mode.timing.h_total,
290 mode.timing.v_display,
291 mode.timing.v_sync_start, mode.timing.v_sync_end,
292 mode.timing.v_total);
294 TRACE(" mode hFreq: %.1f kHz vFreq: %.1f Hz %chSync %cvSync\n",
295 double(mode.timing.pixel_clock) / mode.timing.h_total,
296 ((double(mode.timing.pixel_clock) / mode.timing.h_total) * 1000.0)
297 / mode.timing.v_total,
298 (mode.timing.flags & B_POSITIVE_HSYNC) ? '+' : '-',
299 (mode.timing.flags & B_POSITIVE_VSYNC) ? '+' : '-');
302 status_t status = gInfo.SetDisplayMode(mode);
308 si.displayMode = mode;
323 DisplayModeEx& mode = gInfo.sharedInfo->displayMode;
325 if (mode.timing.h_display + horizontalStart > mode.virtual_width
326 || mode.timing.v_display + verticalStart > mode.virtual_height)
329 mode.h_display_start = horizontalStart;
330 mode.v_display_start = verticalStart;
332 gInfo.AdjustFrame(mode);
340 // Return the number of display modes in the mode list.
360 *current_mode = gInfo.sharedInfo->displayMode; // return current display mode
380 GetPixelClockLimits(display_mode* mode, uint32* low, uint32* high)
382 // Return the maximum and minium pixel clock limits for the specified mode.
387 if ( ! gInfo.GetColorSpaceParams(mode->space, bitsPerPixel, maxPixelClock))
392 uint32 totalClocks = (uint32)mode->timing.h_total * (uint32)mode->timing.v_total;
419 // If the chip is connected to a laptop LCD panel, find the mode with
425 display_mode* mode = FindDisplayMode(si.panelX, si.panelY, 60, 0);
427 if (mode != NULL) {
428 *preferredMode = *mode;