Start source tree (final, I hope!) restructuration. Part 1/X
[reactos.git] / reactos / win32ss / core / drivers / displays / framebuf_new / screen.c
1 /*
2 * PROJECT: ReactOS Framebuffer Display Driver
3 * LICENSE: Microsoft NT4 DDK Sample Code License
4 * FILE: boot/drivers/video/displays/framebuf/screen.c
5 * PURPOSE: Surface, Screen and PDEV support/initialization
6 * PROGRAMMERS: Copyright (c) 1992-1995 Microsoft Corporation
7 * ReactOS Portable Systems Group
8 */
9
10 #include "driver.h"
11
12 #define SYSTM_LOGFONT {16,7,0,0,700,0,0,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,VARIABLE_PITCH | FF_DONTCARE,L"System"}
13 #define HELVE_LOGFONT {12,9,0,0,400,0,0,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_STROKE_PRECIS,PROOF_QUALITY,VARIABLE_PITCH | FF_DONTCARE,L"MS Sans Serif"}
14 #define COURI_LOGFONT {12,9,0,0,400,0,0,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_STROKE_PRECIS,PROOF_QUALITY,FIXED_PITCH | FF_DONTCARE, L"Courier"}
15
16 // This is the basic devinfo for a default driver. This is used as a base and customized based
17 // on information passed back from the miniport driver.
18
19 const DEVINFO gDevInfoFrameBuffer = {
20 ( GCAPS_OPAQUERECT
21 // eVb: 2.8 [DDK CHANGE] - No dithering support
22 // eVb: 2.8 [END]
23 ), /* Graphics capabilities */
24 SYSTM_LOGFONT, /* Default font description */
25 HELVE_LOGFONT, /* ANSI variable font description */
26 COURI_LOGFONT, /* ANSI fixed font description */
27 0, /* Count of device fonts */
28 0, /* Preferred DIB format */
29 // eVb: 2.9 [DDK CHANGE] - No dithering support
30 0, /* Width of color dither */
31 0, /* Height of color dither */
32 // eVb: 2.9 [END]
33 0 /* Default palette to use for this device */
34 };
35
36 /******************************Public*Routine******************************\
37 * bInitSURF
38 *
39 * Enables the surface. Maps the frame buffer into memory.
40 *
41 \**************************************************************************/
42
43 BOOL NTAPI bInitSURF(PPDEV ppdev, BOOL bFirst)
44 {
45 DWORD returnedDataLength;
46 DWORD MaxWidth, MaxHeight;
47 VIDEO_MEMORY videoMemory;
48 VIDEO_MEMORY_INFORMATION videoMemoryInformation;
49 // eVb: 2.1 [DDK Change] - Support new VGA Miniport behavior w.r.t updated framebuffer remapping
50 ULONG RemappingNeeded = 0;
51 // eVb: 2.1 [END]
52 //
53 // Set the current mode into the hardware.
54 //
55
56 if (EngDeviceIoControl(ppdev->hDriver,
57 IOCTL_VIDEO_SET_CURRENT_MODE,
58 &(ppdev->ulMode),
59 sizeof(ULONG),
60 // eVb: 2.2 [DDK Change] - Support new VGA Miniport behavior w.r.t updated framebuffer remapping
61 &RemappingNeeded,
62 sizeof(ULONG),
63 // eVb: 2.2 [END]
64 &returnedDataLength))
65 {
66 RIP("DISP bInitSURF failed IOCTL_SET_MODE\n");
67 return(FALSE);
68 }
69
70 //
71 // If this is the first time we enable the surface we need to map in the
72 // memory also.
73 //
74 // eVb: 2.3 [DDK Change] - Support new VGA Miniport behavior w.r.t updated framebuffer remapping
75 if (bFirst || RemappingNeeded)
76 {
77 // eVb: 2.3 [END]
78 videoMemory.RequestedVirtualAddress = NULL;
79
80 if (EngDeviceIoControl(ppdev->hDriver,
81 IOCTL_VIDEO_MAP_VIDEO_MEMORY,
82 &videoMemory,
83 sizeof(VIDEO_MEMORY),
84 &videoMemoryInformation,
85 sizeof(VIDEO_MEMORY_INFORMATION),
86 &returnedDataLength))
87 {
88 RIP("DISP bInitSURF failed IOCTL_VIDEO_MAP\n");
89 return(FALSE);
90 }
91
92 ppdev->pjScreen = (PBYTE)(videoMemoryInformation.FrameBufferBase);
93
94 if (videoMemoryInformation.FrameBufferBase !=
95 videoMemoryInformation.VideoRamBase)
96 {
97 RIP("VideoRamBase does not correspond to FrameBufferBase\n");
98 }
99 // eVb: 2.4 [DDK Change] - Make sure frame buffer mapping worked
100 //
101 // Make sure we can access this video memory
102 //
103
104 *(PULONG)(ppdev->pjScreen) = 0xaa55aa55;
105
106 if (*(PULONG)(ppdev->pjScreen) != 0xaa55aa55) {
107
108 DISPDBG((1, "Frame buffer memory is not accessible.\n"));
109 return(FALSE);
110 }
111 // eVb: 2.4 [END]
112 ppdev->cScreenSize = videoMemoryInformation.VideoRamLength;
113
114 //
115 // Initialize the head of the offscreen list to NULL.
116 //
117
118 ppdev->pOffscreenList = NULL;
119
120 // It's a hardware pointer; set up pointer attributes.
121
122 MaxHeight = ppdev->PointerCapabilities.MaxHeight;
123
124 // Allocate space for two DIBs (data/mask) for the pointer. If this
125 // device supports a color Pointer, we will allocate a larger bitmap.
126 // If this is a color bitmap we allocate for the largest possible
127 // bitmap because we have no idea of what the pixel depth might be.
128
129 // Width rounded up to nearest byte multiple
130
131 if (!(ppdev->PointerCapabilities.Flags & VIDEO_MODE_COLOR_POINTER))
132 {
133 MaxWidth = (ppdev->PointerCapabilities.MaxWidth + 7) / 8;
134 }
135 else
136 {
137 MaxWidth = ppdev->PointerCapabilities.MaxWidth * sizeof(DWORD);
138 }
139
140 ppdev->cjPointerAttributes =
141 sizeof(VIDEO_POINTER_ATTRIBUTES) +
142 ((sizeof(UCHAR) * MaxWidth * MaxHeight) * 2);
143
144 ppdev->pPointerAttributes = (PVIDEO_POINTER_ATTRIBUTES)
145 EngAllocMem(0, ppdev->cjPointerAttributes, ALLOC_TAG);
146
147 if (ppdev->pPointerAttributes == NULL) {
148
149 DISPDBG((0, "bInitPointer EngAllocMem failed\n"));
150 return(FALSE);
151 }
152
153 ppdev->pPointerAttributes->Flags = ppdev->PointerCapabilities.Flags;
154 ppdev->pPointerAttributes->WidthInBytes = MaxWidth;
155 ppdev->pPointerAttributes->Width = ppdev->PointerCapabilities.MaxWidth;
156 ppdev->pPointerAttributes->Height = MaxHeight;
157 ppdev->pPointerAttributes->Column = 0;
158 ppdev->pPointerAttributes->Row = 0;
159 ppdev->pPointerAttributes->Enable = 0;
160 }
161
162 return(TRUE);
163 }
164
165 /******************************Public*Routine******************************\
166 * vDisableSURF
167 *
168 * Disable the surface. Un-Maps the frame in memory.
169 *
170 \**************************************************************************/
171
172 VOID NTAPI vDisableSURF(PPDEV ppdev)
173 {
174 DWORD returnedDataLength;
175 VIDEO_MEMORY videoMemory;
176
177 videoMemory.RequestedVirtualAddress = (PVOID) ppdev->pjScreen;
178
179 if (EngDeviceIoControl(ppdev->hDriver,
180 IOCTL_VIDEO_UNMAP_VIDEO_MEMORY,
181 &videoMemory,
182 sizeof(VIDEO_MEMORY),
183 NULL,
184 0,
185 &returnedDataLength))
186 {
187 RIP("DISP vDisableSURF failed IOCTL_VIDEO_UNMAP\n");
188 }
189 }
190
191
192 /******************************Public*Routine******************************\
193 * bInitPDEV
194 *
195 * Determine the mode we should be in based on the DEVMODE passed in.
196 * Query mini-port to get information needed to fill in the DevInfo and the
197 * GdiInfo .
198 *
199 \**************************************************************************/
200
201 BOOL NTAPI bInitPDEV(
202 PPDEV ppdev,
203 DEVMODEW *pDevMode,
204 GDIINFO *pGdiInfo,
205 DEVINFO *pDevInfo)
206 {
207 ULONG cModes;
208 PVIDEO_MODE_INFORMATION pVideoBuffer, pVideoModeSelected, pVideoTemp;
209 VIDEO_COLOR_CAPABILITIES colorCapabilities;
210 ULONG ulTemp;
211 BOOL bSelectDefault;
212 ULONG cbModeSize;
213
214 //
215 // calls the miniport to get mode information.
216 //
217
218 cModes = getAvailableModes(ppdev->hDriver, &pVideoBuffer, &cbModeSize);
219
220 if (cModes == 0)
221 {
222 return(FALSE);
223 }
224
225 //
226 // Now see if the requested mode has a match in that table.
227 //
228
229 pVideoModeSelected = NULL;
230 pVideoTemp = pVideoBuffer;
231
232 if ((pDevMode->dmPelsWidth == 0) &&
233 (pDevMode->dmPelsHeight == 0) &&
234 (pDevMode->dmBitsPerPel == 0) &&
235 (pDevMode->dmDisplayFrequency == 0))
236 {
237 DISPDBG((2, "Default mode requested"));
238 bSelectDefault = TRUE;
239 }
240 else
241 {
242 // eVb: 2.5 [DDK Change] - Add missing newlines to debug output
243 DISPDBG((2, "Requested mode...\n"));
244 DISPDBG((2, " Screen width -- %li\n", pDevMode->dmPelsWidth));
245 DISPDBG((2, " Screen height -- %li\n", pDevMode->dmPelsHeight));
246 DISPDBG((2, " Bits per pel -- %li\n", pDevMode->dmBitsPerPel));
247 DISPDBG((2, " Frequency -- %li\n", pDevMode->dmDisplayFrequency));
248 // eVb: 2.5 [END]
249 bSelectDefault = FALSE;
250 }
251
252 while (cModes--)
253 {
254 if (pVideoTemp->Length != 0)
255 {
256 if (bSelectDefault ||
257 ((pVideoTemp->VisScreenWidth == pDevMode->dmPelsWidth) &&
258 (pVideoTemp->VisScreenHeight == pDevMode->dmPelsHeight) &&
259 (pVideoTemp->BitsPerPlane *
260 pVideoTemp->NumberOfPlanes == pDevMode->dmBitsPerPel) &&
261 (pVideoTemp->Frequency == pDevMode->dmDisplayFrequency)))
262 {
263 pVideoModeSelected = pVideoTemp;
264 DISPDBG((3, "Found a match\n")) ;
265 break;
266 }
267 }
268
269 pVideoTemp = (PVIDEO_MODE_INFORMATION)
270 (((PUCHAR)pVideoTemp) + cbModeSize);
271 }
272
273 //
274 // If no mode has been found, return an error
275 //
276
277 if (pVideoModeSelected == NULL)
278 {
279 EngFreeMem(pVideoBuffer);
280 DISPDBG((0,"DISP bInitPDEV failed - no valid modes\n"));
281 return(FALSE);
282 }
283
284 //
285 // Fill in the GDIINFO data structure with the information returned from
286 // the kernel driver.
287 //
288
289 ppdev->ulMode = pVideoModeSelected->ModeIndex;
290 ppdev->cxScreen = pVideoModeSelected->VisScreenWidth;
291 ppdev->cyScreen = pVideoModeSelected->VisScreenHeight;
292 ppdev->ulBitCount = pVideoModeSelected->BitsPerPlane *
293 pVideoModeSelected->NumberOfPlanes;
294 ppdev->lDeltaScreen = pVideoModeSelected->ScreenStride;
295
296 ppdev->flRed = pVideoModeSelected->RedMask;
297 ppdev->flGreen = pVideoModeSelected->GreenMask;
298 ppdev->flBlue = pVideoModeSelected->BlueMask;
299
300
301 pGdiInfo->ulVersion = GDI_DRIVER_VERSION;
302 pGdiInfo->ulTechnology = DT_RASDISPLAY;
303 pGdiInfo->ulHorzSize = pVideoModeSelected->XMillimeter;
304 pGdiInfo->ulVertSize = pVideoModeSelected->YMillimeter;
305
306 pGdiInfo->ulHorzRes = ppdev->cxScreen;
307 pGdiInfo->ulVertRes = ppdev->cyScreen;
308 pGdiInfo->ulPanningHorzRes = ppdev->cxScreen;
309 pGdiInfo->ulPanningVertRes = ppdev->cyScreen;
310 pGdiInfo->cBitsPixel = pVideoModeSelected->BitsPerPlane;
311 pGdiInfo->cPlanes = pVideoModeSelected->NumberOfPlanes;
312 pGdiInfo->ulVRefresh = pVideoModeSelected->Frequency;
313 pGdiInfo->ulBltAlignment = 1; // We don't have accelerated screen-
314 // to-screen blts, and any
315 // window alignment is okay
316
317 pGdiInfo->ulLogPixelsX = pDevMode->dmLogPixels;
318 pGdiInfo->ulLogPixelsY = pDevMode->dmLogPixels;
319
320 #ifdef MIPS
321 if (ppdev->ulBitCount == 8)
322 pGdiInfo->flTextCaps = (TC_RA_ABLE | TC_SCROLLBLT);
323 else
324 #endif
325 pGdiInfo->flTextCaps = TC_RA_ABLE;
326
327 pGdiInfo->flRaster = 0; // flRaster is reserved by DDI
328
329 pGdiInfo->ulDACRed = pVideoModeSelected->NumberRedBits;
330 pGdiInfo->ulDACGreen = pVideoModeSelected->NumberGreenBits;
331 pGdiInfo->ulDACBlue = pVideoModeSelected->NumberBlueBits;
332
333 pGdiInfo->ulAspectX = 0x24; // One-to-one aspect ratio
334 pGdiInfo->ulAspectY = 0x24;
335 pGdiInfo->ulAspectXY = 0x33;
336
337 pGdiInfo->xStyleStep = 1; // A style unit is 3 pels
338 pGdiInfo->yStyleStep = 1;
339 pGdiInfo->denStyleStep = 3;
340
341 pGdiInfo->ptlPhysOffset.x = 0;
342 pGdiInfo->ptlPhysOffset.y = 0;
343 pGdiInfo->szlPhysSize.cx = 0;
344 pGdiInfo->szlPhysSize.cy = 0;
345
346 // RGB and CMY color info.
347
348 //
349 // try to get it from the miniport.
350 // if the miniport doesn ot support this feature, use defaults.
351 //
352
353 if (EngDeviceIoControl(ppdev->hDriver,
354 IOCTL_VIDEO_QUERY_COLOR_CAPABILITIES,
355 NULL,
356 0,
357 &colorCapabilities,
358 sizeof(VIDEO_COLOR_CAPABILITIES),
359 &ulTemp))
360 {
361
362 DISPDBG((2, "getcolorCapabilities failed \n"));
363
364 pGdiInfo->ciDevice.Red.x = 6700;
365 pGdiInfo->ciDevice.Red.y = 3300;
366 pGdiInfo->ciDevice.Red.Y = 0;
367 pGdiInfo->ciDevice.Green.x = 2100;
368 pGdiInfo->ciDevice.Green.y = 7100;
369 pGdiInfo->ciDevice.Green.Y = 0;
370 pGdiInfo->ciDevice.Blue.x = 1400;
371 pGdiInfo->ciDevice.Blue.y = 800;
372 pGdiInfo->ciDevice.Blue.Y = 0;
373 pGdiInfo->ciDevice.AlignmentWhite.x = 3127;
374 pGdiInfo->ciDevice.AlignmentWhite.y = 3290;
375 pGdiInfo->ciDevice.AlignmentWhite.Y = 0;
376
377 pGdiInfo->ciDevice.RedGamma = 20000;
378 pGdiInfo->ciDevice.GreenGamma = 20000;
379 pGdiInfo->ciDevice.BlueGamma = 20000;
380
381 }
382 else
383 {
384 pGdiInfo->ciDevice.Red.x = colorCapabilities.RedChromaticity_x;
385 pGdiInfo->ciDevice.Red.y = colorCapabilities.RedChromaticity_y;
386 pGdiInfo->ciDevice.Red.Y = 0;
387 pGdiInfo->ciDevice.Green.x = colorCapabilities.GreenChromaticity_x;
388 pGdiInfo->ciDevice.Green.y = colorCapabilities.GreenChromaticity_y;
389 pGdiInfo->ciDevice.Green.Y = 0;
390 pGdiInfo->ciDevice.Blue.x = colorCapabilities.BlueChromaticity_x;
391 pGdiInfo->ciDevice.Blue.y = colorCapabilities.BlueChromaticity_y;
392 pGdiInfo->ciDevice.Blue.Y = 0;
393 pGdiInfo->ciDevice.AlignmentWhite.x = colorCapabilities.WhiteChromaticity_x;
394 pGdiInfo->ciDevice.AlignmentWhite.y = colorCapabilities.WhiteChromaticity_y;
395 pGdiInfo->ciDevice.AlignmentWhite.Y = colorCapabilities.WhiteChromaticity_Y;
396
397 // if we have a color device store the three color gamma values,
398 // otherwise store the unique gamma value in all three.
399
400 if (colorCapabilities.AttributeFlags & VIDEO_DEVICE_COLOR)
401 {
402 pGdiInfo->ciDevice.RedGamma = colorCapabilities.RedGamma;
403 pGdiInfo->ciDevice.GreenGamma = colorCapabilities.GreenGamma;
404 pGdiInfo->ciDevice.BlueGamma = colorCapabilities.BlueGamma;
405 }
406 else
407 {
408 pGdiInfo->ciDevice.RedGamma = colorCapabilities.WhiteGamma;
409 pGdiInfo->ciDevice.GreenGamma = colorCapabilities.WhiteGamma;
410 pGdiInfo->ciDevice.BlueGamma = colorCapabilities.WhiteGamma;
411 }
412
413 };
414
415 pGdiInfo->ciDevice.Cyan.x = 0;
416 pGdiInfo->ciDevice.Cyan.y = 0;
417 pGdiInfo->ciDevice.Cyan.Y = 0;
418 pGdiInfo->ciDevice.Magenta.x = 0;
419 pGdiInfo->ciDevice.Magenta.y = 0;
420 pGdiInfo->ciDevice.Magenta.Y = 0;
421 pGdiInfo->ciDevice.Yellow.x = 0;
422 pGdiInfo->ciDevice.Yellow.y = 0;
423 pGdiInfo->ciDevice.Yellow.Y = 0;
424
425 // No dye correction for raster displays.
426
427 pGdiInfo->ciDevice.MagentaInCyanDye = 0;
428 pGdiInfo->ciDevice.YellowInCyanDye = 0;
429 pGdiInfo->ciDevice.CyanInMagentaDye = 0;
430 pGdiInfo->ciDevice.YellowInMagentaDye = 0;
431 pGdiInfo->ciDevice.CyanInYellowDye = 0;
432 pGdiInfo->ciDevice.MagentaInYellowDye = 0;
433
434 pGdiInfo->ulDevicePelsDPI = 0; // For printers only
435 pGdiInfo->ulPrimaryOrder = PRIMARY_ORDER_CBA;
436
437 // BUGBUG this should be modified to take into account the size
438 // of the display and the resolution.
439
440 pGdiInfo->ulHTPatternSize = HT_PATSIZE_4x4_M;
441
442 pGdiInfo->flHTFlags = HT_FLAG_ADDITIVE_PRIMS;
443
444 // Fill in the basic devinfo structure
445
446 *pDevInfo = gDevInfoFrameBuffer;
447
448 // Fill in the rest of the devinfo and GdiInfo structures.
449
450 if (ppdev->ulBitCount == 8)
451 {
452 // It is Palette Managed.
453
454 pGdiInfo->ulNumColors = 20;
455 pGdiInfo->ulNumPalReg = 1 << ppdev->ulBitCount;
456 // eVb: 2.7 [DDK CHANGE] - No dithering support
457 pDevInfo->flGraphicsCaps |= GCAPS_PALMANAGED;
458 // eVb: 2.7 [END]
459 pGdiInfo->ulHTOutputFormat = HT_FORMAT_8BPP;
460 pDevInfo->iDitherFormat = BMF_8BPP;
461
462 // Assuming palette is orthogonal - all colors are same size.
463
464 ppdev->cPaletteShift = 8 - pGdiInfo->ulDACRed;
465 }
466 else
467 {
468 pGdiInfo->ulNumColors = (ULONG) (-1);
469 pGdiInfo->ulNumPalReg = 0;
470
471 if (ppdev->ulBitCount == 16)
472 {
473 pGdiInfo->ulHTOutputFormat = HT_FORMAT_16BPP;
474 pDevInfo->iDitherFormat = BMF_16BPP;
475 }
476 else if (ppdev->ulBitCount == 24)
477 {
478 pGdiInfo->ulHTOutputFormat = HT_FORMAT_24BPP;
479 pDevInfo->iDitherFormat = BMF_24BPP;
480 }
481 else
482 {
483 pGdiInfo->ulHTOutputFormat = HT_FORMAT_32BPP;
484 pDevInfo->iDitherFormat = BMF_32BPP;
485 }
486 }
487
488 EngFreeMem(pVideoBuffer);
489
490 return(TRUE);
491 }
492
493
494 /******************************Public*Routine******************************\
495 * getAvailableModes
496 *
497 * Calls the miniport to get the list of modes supported by the kernel driver,
498 * and returns the list of modes supported by the diplay driver among those
499 *
500 * returns the number of entries in the videomode buffer.
501 * 0 means no modes are supported by the miniport or that an error occured.
502 *
503 * NOTE: the buffer must be freed up by the caller.
504 *
505 \**************************************************************************/
506
507 DWORD NTAPI getAvailableModes(
508 HANDLE hDriver,
509 PVIDEO_MODE_INFORMATION *modeInformation,
510 DWORD *cbModeSize)
511 {
512 ULONG ulTemp;
513 VIDEO_NUM_MODES modes;
514 PVIDEO_MODE_INFORMATION pVideoTemp;
515
516 //
517 // Get the number of modes supported by the mini-port
518 //
519
520 if (EngDeviceIoControl(hDriver,
521 IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES,
522 NULL,
523 0,
524 &modes,
525 sizeof(VIDEO_NUM_MODES),
526 &ulTemp))
527 {
528 DISPDBG((0, "getAvailableModes failed VIDEO_QUERY_NUM_AVAIL_MODES\n"));
529 return(0);
530 }
531
532 *cbModeSize = modes.ModeInformationLength;
533
534 //
535 // Allocate the buffer for the mini-port to write the modes in.
536 //
537
538 *modeInformation = (PVIDEO_MODE_INFORMATION)
539 EngAllocMem(0, modes.NumModes *
540 modes.ModeInformationLength, ALLOC_TAG);
541
542 if (*modeInformation == (PVIDEO_MODE_INFORMATION) NULL)
543 {
544 DISPDBG((0, "getAvailableModes failed EngAllocMem\n"));
545
546 return 0;
547 }
548
549 //
550 // Ask the mini-port to fill in the available modes.
551 //
552
553 if (EngDeviceIoControl(hDriver,
554 IOCTL_VIDEO_QUERY_AVAIL_MODES,
555 NULL,
556 0,
557 *modeInformation,
558 modes.NumModes * modes.ModeInformationLength,
559 &ulTemp))
560 {
561
562 DISPDBG((0, "getAvailableModes failed VIDEO_QUERY_AVAIL_MODES\n"));
563
564 EngFreeMem(*modeInformation);
565 *modeInformation = (PVIDEO_MODE_INFORMATION) NULL;
566
567 return(0);
568 }
569
570 //
571 // Now see which of these modes are supported by the display driver.
572 // As an internal mechanism, set the length to 0 for the modes we
573 // DO NOT support.
574 //
575
576 ulTemp = modes.NumModes;
577 pVideoTemp = *modeInformation;
578
579 //
580 // Mode is rejected if it is not one plane, or not graphics, or is not
581 // one of 8, 16 or 32 bits per pel.
582 //
583
584 while (ulTemp--)
585 {
586 if ((pVideoTemp->NumberOfPlanes != 1 ) ||
587 !(pVideoTemp->AttributeFlags & VIDEO_MODE_GRAPHICS) ||
588 // eVb: 2.6 [DDK CHANGE] - Do not process banked video modes
589 (pVideoTemp->AttributeFlags & VIDEO_MODE_BANKED) ||
590 // eVb: 2.6 [END]
591 ((pVideoTemp->BitsPerPlane != 8) &&
592 (pVideoTemp->BitsPerPlane != 16) &&
593 (pVideoTemp->BitsPerPlane != 24) &&
594 (pVideoTemp->BitsPerPlane != 32)))
595 {
596 pVideoTemp->Length = 0;
597 }
598
599 pVideoTemp = (PVIDEO_MODE_INFORMATION)
600 (((PUCHAR)pVideoTemp) + modes.ModeInformationLength);
601 }
602
603 return modes.NumModes;
604
605 }