Lines Matching refs:mode

18 IsThereEnoughFBMemory(const display_mode* mode, uint32 bitsPerPixel)
20 // Test if there is enough Frame Buffer memory for the mode and color depth
23 uint32 maxWidth = mode->virtual_width;
24 if (mode->timing.h_display > maxWidth)
25 maxWidth = mode->timing.h_display;
27 uint32 maxHeight = mode->virtual_height;
28 if (mode->timing.v_display > maxHeight)
29 maxHeight = mode->timing.v_display;
39 IsModeUsable(const display_mode* mode)
41 // Test if the display mode is usable by the current video chip. That is,
42 // does the chip have enough memory for the mode and is the pixel clock
45 // Return true if the mode is usable.
50 if (!TDFX_GetColorSpaceParams(mode->space, bitsPerPixel))
53 // Is there enough frame buffer memory to handle the mode?
55 if (!IsThereEnoughFBMemory(mode, bitsPerPixel))
58 if (mode->timing.pixel_clock > si.maxPixelClock)
65 if (mode->space == uint32(si.colorSpaces[j])) {
74 // In clock doubled mode for 3DFX chips, widths must be divisible by 16
77 if ((mode->timing.pixel_clock > si.maxPixelClock / 2)
78 && (mode->timing.h_display % 16) != 0)
84 if (mode->timing.h_display == 640 && mode->timing.v_display < 480)
92 CreateModeList(bool (*checkMode)(const display_mode* mode))
96 // Obtain EDID info which is needed for for building the mode list. If
144 // In clock doubled mode for 3DFX chips, widths must be divisible by 16
151 // Search the mode list for the specified mode.
156 display_mode& mode = gInfo.modeList[j];
158 if (target->timing.h_display == mode.timing.h_display
159 && target->timing.v_display == mode.timing.v_display
160 && target->space == mode.space)
161 return B_OK; // mode found in list
164 return B_BAD_VALUE; // mode not found in list
171 // First validate the mode, then call a function to set the registers.
176 DisplayModeEx mode;
177 (display_mode&)mode = *pMode;
179 if (!TDFX_GetColorSpaceParams(mode.space, mode.bitsPerPixel))
182 if (ProposeDisplayMode(&mode, pMode, pMode) != B_OK)
185 mode.bytesPerPixel = (mode.bitsPerPixel + 7) / 8;
186 mode.bytesPerRow = mode.timing.h_display * mode.bytesPerPixel;
188 // Is there enough frame buffer memory for this mode?
190 if ( ! IsThereEnoughFBMemory(&mode, mode.bitsPerPixel))
193 TRACE("Set display mode: %dx%d virtual size: %dx%d "
195 mode.timing.h_display, mode.timing.v_display,
196 mode.virtual_width, mode.virtual_height, mode.bitsPerPixel);
198 TRACE(" mode timing: %d %d %d %d %d %d %d %d %d\n",
199 mode.timing.pixel_clock,
200 mode.timing.h_display,
201 mode.timing.h_sync_start, mode.timing.h_sync_end,
202 mode.timing.h_total,
203 mode.timing.v_display,
204 mode.timing.v_sync_start, mode.timing.v_sync_end,
205 mode.timing.v_total);
207 TRACE(" mode hFreq: %.1f kHz vFreq: %.1f Hz %chSync %cvSync\n",
208 double(mode.timing.pixel_clock) / mode.timing.h_total,
209 ((double(mode.timing.pixel_clock) / mode.timing.h_total) * 1000.0)
210 / mode.timing.v_total,
211 (mode.timing.flags & B_POSITIVE_HSYNC) ? '+' : '-',
212 (mode.timing.flags & B_POSITIVE_VSYNC) ? '+' : '-');
214 status_t status = TDFX_SetDisplayMode(mode);
220 si.displayMode = mode;
234 DisplayModeEx& mode = gInfo.sharedInfo->displayMode;
236 if (mode.timing.h_display + horizontalStart > mode.virtual_width
237 || mode.timing.v_display + verticalStart > mode.virtual_height)
240 mode.h_display_start = horizontalStart;
241 mode.v_display_start = verticalStart;
243 TDFX_AdjustFrame(mode);
251 // Return the number of display modes in the mode list.
272 *current_mode = gInfo.sharedInfo->displayMode; // return current display mode
294 GetPixelClockLimits(display_mode* mode, uint32* low, uint32* high)
296 // Return the maximum and minium pixel clock limits for the specified mode.
301 if (!TDFX_GetColorSpaceParams(mode->space, bitsPerPixel))
306 uint32 totalClocks = (uint32)mode->timing.h_total
307 * (uint32)mode->timing.v_total;
316 // In clock doubled mode for 3DFX chips, widths must be divisible by 16
321 if ((mode->timing.h_display % 16) != 0)