Lines Matching refs:mode

17 InitCrtcTimingValues(const DisplayModeEx& mode, int horzScaleFactor, uint8 crtc[],
29 int hTotal = (mode.timing.h_total * horzScaleFactor) / 8 - 5;
30 int hDisp_e = (mode.timing.h_display * horzScaleFactor) / 8 - 1;
31 int hSync_s = (mode.timing.h_sync_start * horzScaleFactor) / 8;
32 int hSync_e = (mode.timing.h_sync_end * horzScaleFactor) / 8;
36 int vTotal = mode.timing.v_total - 2;
37 int vDisp_e = mode.timing.v_display - 1;
38 int vSync_s = mode.timing.v_sync_start;
39 int vSync_e = mode.timing.v_sync_end;
72 crtc[0x13] = mode.bytesPerRow / 8;
114 // Search the mode list for the mode with specified width, height,
116 // function will search for a mode satisfying the other 3 arguments, and
117 // if more than one matching mode is found, the one with the greatest color
127 display_mode& mode = gInfo.modeList[j];
129 if (mode.timing.h_display == width && mode.timing.v_display == height) {
130 int modeRefreshRate = int(((mode.timing.pixel_clock * 1000.0 /
131 mode.timing.h_total) / mode.timing.v_total) + 0.5);
134 if (selectedMode == NULL || mode.space > selectedMode->space)
135 selectedMode = &mode;
137 if (mode.space == colorDepth)
138 return &mode;
150 IsThereEnoughFBMemory(const display_mode* mode, uint32 bitsPerPixel)
152 // Test if there is enough Frame Buffer memory for the mode and color depth
155 uint32 maxWidth = mode->virtual_width;
156 if (mode->timing.h_display > maxWidth)
157 maxWidth = mode->timing.h_display;
159 uint32 maxHeight = mode->virtual_height;
160 if (mode->timing.v_display > maxHeight)
161 maxHeight = mode->timing.v_display;
171 IsModeUsable(const display_mode* mode)
173 // Test if the display mode is usable by the current video chip. That is,
174 // does the chip have enough memory for the mode and is the pixel clock
177 // Return true if the mode is usable.
183 if ( ! gInfo.GetColorSpaceParams(mode->space, bitsPerPixel, maxPixelClock))
186 // Is there enough frame buffer memory to handle the mode?
188 if ( ! IsThereEnoughFBMemory(mode, bitsPerPixel))
191 if (mode->timing.pixel_clock > maxPixelClock)
198 if (mode->space == uint32(si.colorSpaces[j])) {
210 if (mode->timing.h_display == 640 && mode->timing.v_display < 480)
214 // computer), restrict the display mode to resolutions where the width and
215 // height of the mode are less than or equal to the width and height of the
219 && (mode->timing.h_display > si.panelX
220 || mode->timing.v_display > si.panelY)) {
229 CreateModeList( bool (*checkMode)(const display_mode* mode),
234 // Obtain EDID info which is needed for for building the mode list.
304 // Search the mode list for the specified mode.
309 display_mode& mode = gInfo.modeList[j];
311 if (target->timing.h_display == mode.timing.h_display
312 && target->timing.v_display == mode.timing.v_display
313 && target->space == mode.space)
314 return B_OK; // mode found in list
317 return B_BAD_VALUE; // mode not found in list
325 // First validate the mode, then call a function to set the registers.
330 DisplayModeEx mode;
331 (display_mode&)mode = *pMode;
334 if ( ! gInfo.GetColorSpaceParams(mode.space, mode.bpp, maxPixelClock))
337 if (ProposeDisplayMode(&mode, pMode, pMode) != B_OK)
345 if (mode.timing.h_display == 1400 && (si.chipType == S3_PROSAVAGE
350 mode.timing.h_display = 1408;
351 mode.virtual_width = 1408;
354 int bytesPerPixel = (mode.bpp + 7) / 8;
355 mode.bytesPerRow = mode.timing.h_display * bytesPerPixel;
357 // Is there enough frame buffer memory for this mode?
359 if ( ! IsThereEnoughFBMemory(&mode, mode.bpp))
362 TRACE("Set display mode: %dx%d virtual size: %dx%d color depth: %d bpp\n",
363 mode.timing.h_display, mode.timing.v_display,
364 mode.virtual_width, mode.virtual_height, mode.bpp);
366 TRACE(" mode timing: %d %d %d %d %d %d %d %d %d\n",
367 mode.timing.pixel_clock,
368 mode.timing.h_display,
369 mode.timing.h_sync_start, mode.timing.h_sync_end,
370 mode.timing.h_total,
371 mode.timing.v_display,
372 mode.timing.v_sync_start, mode.timing.v_sync_end,
373 mode.timing.v_total);
375 TRACE(" mode hFreq: %.1f kHz vFreq: %.1f Hz %chSync %cvSync\n",
376 double(mode.timing.pixel_clock) / mode.timing.h_total,
377 ((double(mode.timing.pixel_clock) / mode.timing.h_total) * 1000.0)
378 / mode.timing.v_total,
379 (mode.timing.flags & B_POSITIVE_HSYNC) ? '+' : '-',
380 (mode.timing.flags & B_POSITIVE_VSYNC) ? '+' : '-');
382 if ( ! gInfo.SetDisplayMode(mode))
385 si.displayMode = mode;
400 DisplayModeEx& mode = gInfo.sharedInfo->displayMode;
402 if (mode.timing.h_display + horizontalStart > mode.virtual_width
403 || mode.timing.v_display + verticalStart > mode.virtual_height)
406 mode.h_display_start = horizontalStart;
407 mode.v_display_start = verticalStart;
409 gInfo.AdjustFrame(mode);
417 // Return the number of display modes in the mode list.
437 *current_mode = gInfo.sharedInfo->displayMode; // return current display mode
457 GetPixelClockLimits(display_mode* mode, uint32* low, uint32* high)
459 // Return the maximum and minium pixel clock limits for the specified mode.
464 if ( ! gInfo.GetColorSpaceParams(mode->space, bitsPerPixel, maxPixelClock))
469 uint32 totalClocks = (uint32)mode->timing.h_total * (uint32)mode->timing.v_total;
496 // If the chip is connected to a laptop LCD panel, find the mode with
502 display_mode* mode = FindDisplayMode(si.panelX, si.panelY, 60, 0);
504 if (mode != NULL) {
505 *preferredMode = *mode;