Skip to content

Commit d188f28

Browse files
committed
** Further investigate framebuffer info structure
1 parent 462c6d5 commit d188f28

File tree

2 files changed

+51
-39
lines changed

2 files changed

+51
-39
lines changed

boot/freeldr/freeldr/arch/vidfb.c

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,28 +33,20 @@ typedef ULONG RGBQUAD; // , COLORREF;
3333

3434
/* GLOBALS ********************************************************************/
3535

36-
typedef struct _FRAMEBUFFER_INFO
36+
typedef struct _FRAMEBUFFER_DATA
3737
{
3838
ULONG_PTR BaseAddress;
3939
ULONG BufferSize;
4040

41-
/* Horizontal and Vertical resolution in pixels */
42-
ULONG ScreenWidth;
43-
ULONG ScreenHeight;
44-
45-
/* Number of pixel elements per video memory line */
46-
ULONG PixelsPerScanLine; // aka. "Pitch" or "ScreenStride", but Stride is in bytes or bits...
47-
ULONG BitsPerPixel; // aka. "PixelStride".
48-
49-
/* Physical format of the pixel for BPP > 8, specified by bit-mask */
50-
PIXEL_BITMASK PixelMasks;
41+
/* Framebuffer characteristics */
42+
FRAMEBUFFER_INFO;
5143

5244
/** Calculated values */
5345

5446
ULONG BytesPerPixel;
55-
ULONG Delta; // aka. "Pitch": actual size in bytes of a scanline.
47+
ULONG Delta; // aka. "Pitch": actual size in bytes of a scanline.
5648

57-
/* Calculated number of bits from the masks above */
49+
/* Calculated number of bits from pixel masks */
5850
UCHAR RedMaskSize;
5951
UCHAR GreenMaskSize;
6052
UCHAR BlueMaskSize;
@@ -65,9 +57,9 @@ typedef struct _FRAMEBUFFER_INFO
6557
UCHAR GreenMaskPosition;
6658
UCHAR BlueMaskPosition;
6759
UCHAR ReservedMaskPosition;
68-
} FRAMEBUFFER_INFO, *PFRAMEBUFFER_INFO;
60+
} FRAMEBUFFER_DATA, *PFRAMEBUFFER_DATA;
6961

70-
static FRAMEBUFFER_INFO framebufInfo = {0};
62+
static FRAMEBUFFER_DATA framebufInfo = {0};
7163
static CM_FRAMEBUF_DEVICE_DATA FrameBufferData = {0};
7264

7365
static UINT8 VidpXScale = 1;
@@ -643,7 +635,7 @@ color_scale_component(
643635
static UINT32 // RescaleColor()
644636
color_scale_argb(
645637
_In_ UINT32 Color,
646-
_In_ PFRAMEBUFFER_INFO FbInfo)
638+
_In_ PFRAMEBUFFER_DATA FbInfo)
647639
{
648640
//UINT32 scRsvd = color_scale_component(GetAValue(Color), FbInfo->ReservedMaskSize);
649641
UINT32 scRed = color_scale_component(GetRValue(Color), FbInfo->RedMaskSize);

sdk/include/reactos/drivers/bootvid/framebuf.h

Lines changed: 43 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,46 @@
1414
extern "C" {
1515
#endif
1616

17+
/**
18+
* @brief
19+
* Physical format of an RGB pixel, specified with per-component bit-masks.
20+
* A bit being set defines those used for the given color component, such
21+
* as Red, Green, Blue, or Reserved.
22+
*
23+
* @note
24+
* Supports up to 32 bits-per-pixel deep pixels.
25+
**/
26+
typedef struct _PIXEL_BITMASK
27+
{
28+
ULONG RedMask;
29+
ULONG GreenMask;
30+
ULONG BlueMask;
31+
ULONG ReservedMask;
32+
} PIXEL_BITMASK, *PPIXEL_BITMASK;
33+
34+
/**
35+
* @brief Framebuffer characteristics.
36+
**/
37+
typedef struct _FRAMEBUFFER_INFO
38+
{
39+
/* The framebuffer size is obtained by:
40+
* FrameBufferSize = ScreenHeight * PixelsPerScanLine * BytesPerPixel */
41+
// ULONG BufferSize;
42+
43+
/* Horizontal and Vertical resolution in pixels */
44+
ULONG ScreenWidth;
45+
ULONG ScreenHeight;
46+
47+
/* Number of pixel elements per video memory line. Related to
48+
* the number of bytes per scan-line (pitch/screen stride) via:
49+
* Pitch = PixelsPerScanLine * BytesPerPixel */
50+
ULONG PixelsPerScanLine; ///< Pitch/stride in pixels
51+
ULONG BitsPerPixel; ///< Pixel depth
52+
53+
/* Pixel physical format for BPP > 8 */
54+
PIXEL_BITMASK PixelMasks;
55+
} FRAMEBUFFER_INFO, *PFRAMEBUFFER_INFO;
56+
1757
/**
1858
* @brief Framebuffer-specific video device configuration data.
1959
*
@@ -35,31 +75,11 @@ typedef struct _CM_FRAMEBUF_DEVICE_DATA
3575
{
3676
CM_VIDEO_DEVICE_DATA;
3777

38-
/* Absolute offset from the start of the video RAM of the framebuffer
39-
* to be displayed on the monitor. The framebuffer size is obtained by:
40-
* FrameBufferSize = ScreenHeight * PixelsPerScanLine * BytesPerPixel */
78+
/* Absolute offset from the start of the video RAM
79+
* of the framebuffer to be displayed */
4180
ULONG FrameBufferOffset;
4281

43-
/* Horizontal and Vertical resolution in pixels */
44-
ULONG ScreenWidth;
45-
ULONG ScreenHeight;
46-
47-
/* Number of pixel elements per video memory line. Related to
48-
* the number of bytes per scan-line (pitch/screen stride) via:
49-
* Pitch = PixelsPerScanLine * BytesPerPixel */
50-
ULONG PixelsPerScanLine; ///< Pitch/stride in pixels
51-
ULONG BitsPerPixel; ///< Pixel depth
52-
53-
/* Pixel physical format for BPP > 8, specified by bit-masks.
54-
* A bit being set defines those used for the given color component,
55-
* such as Red, Green, Blue, or Reserved. */
56-
struct /*_PIXEL_BITMASK*/
57-
{
58-
ULONG RedMask;
59-
ULONG GreenMask;
60-
ULONG BlueMask;
61-
ULONG ReservedMask;
62-
} PixelMasks; /*PIXEL_BITMASK, *PPIXEL_BITMASK*/
82+
FRAMEBUFFER_INFO; ///< Framebuffer characteristics
6383

6484
} CM_FRAMEBUF_DEVICE_DATA, *PCM_FRAMEBUF_DEVICE_DATA;
6585

0 commit comments

Comments
 (0)