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.
51 if (!I810_GetColorSpaceParams(mode->space, bitsPerPixel, maxPixelClock))
54 // Is there enough frame buffer memory to handle the mode?
56 if (!IsThereEnoughFBMemory(mode, bitsPerPixel))
59 if (mode->timing.pixel_clock > maxPixelClock)
66 if (mode->space == uint32(si.colorSpaces[j])) {
78 if (mode->timing.h_display == 640 && mode->timing.v_display < 480)
86 CreateModeList(bool (*checkMode)(const display_mode* mode))
90 // Obtain EDID info which is needed for for building the mode list.
147 // Search the mode list for the specified mode.
152 display_mode& mode = gInfo.modeList[j];
154 if (target->timing.h_display == mode.timing.h_display
155 && target->timing.v_display == mode.timing.v_display
156 && target->space == mode.space)
157 return B_OK; // mode found in list
160 return B_BAD_VALUE; // mode not found in list
167 // First validate the mode, then call a function to set the registers.
172 DisplayModeEx mode;
173 (display_mode&)mode = *pMode;
176 if (!I810_GetColorSpaceParams(mode.space, mode.bitsPerPixel, maxPixelClock))
179 if (ProposeDisplayMode(&mode, pMode, pMode) != B_OK)
182 mode.bytesPerPixel = (mode.bitsPerPixel + 7) / 8;
183 mode.bytesPerRow = mode.timing.h_display * mode.bytesPerPixel;
185 // Is there enough frame buffer memory for this mode?
187 if ( ! IsThereEnoughFBMemory(&mode, mode.bitsPerPixel))
190 TRACE("Set display mode: %dx%d virtual size: %dx%d "
192 mode.timing.h_display, mode.timing.v_display,
193 mode.virtual_width, mode.virtual_height, mode.bitsPerPixel);
195 TRACE(" mode timing: %d %d %d %d %d %d %d %d %d\n",
196 mode.timing.pixel_clock,
197 mode.timing.h_display,
198 mode.timing.h_sync_start, mode.timing.h_sync_end,
199 mode.timing.h_total,
200 mode.timing.v_display,
201 mode.timing.v_sync_start, mode.timing.v_sync_end,
202 mode.timing.v_total);
204 TRACE(" mode hFreq: %.1f kHz vFreq: %.1f Hz %chSync %cvSync\n",
205 double(mode.timing.pixel_clock) / mode.timing.h_total,
206 ((double(mode.timing.pixel_clock) / mode.timing.h_total) * 1000.0)
207 / mode.timing.v_total,
208 (mode.timing.flags & B_POSITIVE_HSYNC) ? '+' : '-',
209 (mode.timing.flags & B_POSITIVE_VSYNC) ? '+' : '-');
211 status_t status = I810_SetDisplayMode(mode);
217 si.displayMode = mode;
231 DisplayModeEx& mode = gInfo.sharedInfo->displayMode;
233 if (mode.timing.h_display + horizontalStart > mode.virtual_width
234 || mode.timing.v_display + verticalStart > mode.virtual_height)
237 mode.h_display_start = horizontalStart;
238 mode.v_display_start = verticalStart;
240 I810_AdjustFrame(mode);
248 // Return the number of display modes in the mode list.
269 *current_mode = gInfo.sharedInfo->displayMode; // current display mode
289 GetPixelClockLimits(display_mode* mode, uint32* low, uint32* high)
291 // Return the maximum and minium pixel clock limits for the specified mode.
296 if (!I810_GetColorSpaceParams(mode->space, bitsPerPixel, maxPixelClock))
301 uint32 totalClocks = (uint32)mode->timing.h_total
302 * (uint32)mode->timing.v_total;