clean up and standardize types across the codebase, unify atomic operations, improve UTF-8 handling throughout the system, remove obsolete input and named queue interfaces, redesign process preparation and creation, tighten IPC and service boundaries, improve error handling and reliability, minor documentation cleanup, fix doom surfaces, fix panic in ini parsing.
This commit is contained in:
1 parent
899225f551
commit
c0ad63c27f
226 files changed
+6562
-4147
No files matched your search
+105
-104
@@ -1,5 +1,6 @@
|
||||
// Kernel display manager. This file owns provider registration, framebuffer routing, dirty rectangles, text console state, and cursor delegation.
|
||||
|
||||
#include <ntlite/atomic.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
@@ -72,12 +73,12 @@ static SPINLOCK gDisplayLock = SPINLOCK_INIT;
|
||||
static MUTEX* gDisplayProviderMutex;
|
||||
static MUTEX* gDisplayOutputMutex;
|
||||
static KWORK_ITEM gDisplayCursorWorkItem;
|
||||
static volatile long gDisplayCursorWorkInitialized;
|
||||
static volatile int32_t gDisplayCursorWorkInitialized;
|
||||
static bool gDisplayTransitionInProgress;
|
||||
static uint64_t gDisplayGeneration;
|
||||
static LIST_ENTRY gDisplayClockList;
|
||||
static SPINLOCK gDisplayClockLock = SPINLOCK_INIT;
|
||||
static volatile long gDisplayClockInitialized;
|
||||
static volatile int32_t gDisplayClockInitialized;
|
||||
static uint64_t gDisplayFrameGeneration;
|
||||
|
||||
static DISPLAY_DEVICE gBootFbDevice;
|
||||
@@ -106,27 +107,27 @@ static int gConsoleY;
|
||||
static uint16_t gConsoleAttribute;
|
||||
static char gConsoleCells[DISPLAY_CONSOLE_MAX_CELLS];
|
||||
static uint8_t gConsoleAttrs[DISPLAY_CONSOLE_MAX_CELLS];
|
||||
static volatile long gDisplayConsoleSuspended;
|
||||
static volatile int32_t gDisplayConsoleSuspended;
|
||||
static SPINLOCK gDisplayOutputLock = SPINLOCK_INIT;
|
||||
static DISPLAY_OUTPUT_GLYPH* gDisplayOutputBuffer;
|
||||
static size_t gDisplayOutputRead;
|
||||
static size_t gDisplayOutputWrite;
|
||||
static size_t gDisplayOutputUsed;
|
||||
static KWORK_ITEM gDisplayOutputWorkItem;
|
||||
static volatile long gDisplayOutputWorkInitialized;
|
||||
static volatile int32_t gDisplayOutputWorkInitialized;
|
||||
|
||||
static KSTATUS KiDisplayPrintCharInternal(char c, uint32_t fg, uint32_t bg);
|
||||
static KSTATUS KiDisplayPrintGlyphsInternal(const DISPLAY_OUTPUT_GLYPH* glyphs, size_t count);
|
||||
static KSTATUS BootFbGetMode(DISPLAY_DEVICE* device, DISPLAY_MODE* outMode);
|
||||
static KSTATUS BootFbBlit(DISPLAY_DEVICE* device, int x, int y, int w, int h, const uint32_t* pixels, uint32_t pitchBytes);
|
||||
static KSTATUS BootFbPresentPitched(DISPLAY_DEVICE* device, int x, int y, int w, int h, const uint32_t* pixels, uint32_t pitchBytes);
|
||||
static KSTATUS BootFbFillRect(DISPLAY_DEVICE* device, int x, int y, int w, int h, uint32_t color);
|
||||
static KSTATUS BootFbCopyRect(DISPLAY_DEVICE* device, int dstX, int dstY, int srcX, int srcY, int w, int h);
|
||||
static KSTATUS BootFbReadRect(DISPLAY_DEVICE* device, int x, int y, int w, int h, uint32_t* outPixels, uint32_t outStride);
|
||||
static KSTATUS BootFbBlit(DISPLAY_DEVICE* device, int32_t x, int32_t y, int32_t w, int32_t h, const uint32_t* pixels, uint32_t pitchBytes);
|
||||
static KSTATUS BootFbPresentPitched(DISPLAY_DEVICE* device, int32_t x, int32_t y, int32_t w, int32_t h, const uint32_t* pixels, uint32_t pitchBytes);
|
||||
static KSTATUS BootFbFillRect(DISPLAY_DEVICE* device, int32_t x, int32_t y, int32_t w, int32_t h, uint32_t color);
|
||||
static KSTATUS BootFbCopyRect(DISPLAY_DEVICE* device, int32_t dstX, int32_t dstY, int32_t srcX, int32_t srcY, int32_t w, int32_t h);
|
||||
static KSTATUS BootFbReadRect(DISPLAY_DEVICE* device, int32_t x, int32_t y, int32_t w, int32_t h, uint32_t* outPixels, uint32_t outStride);
|
||||
static KSTATUS BootFbPresent(DISPLAY_DEVICE* device, const DISPLAY_RECT* rects, size_t rectCount);
|
||||
static KSTATUS BootFbSync(DISPLAY_DEVICE* device);
|
||||
static KSTATUS BootFbSetCursorImage(DISPLAY_DEVICE* device, int width, int height, int hotX, int hotY, const uint32_t* argbPixels);
|
||||
static KSTATUS BootFbSetCursorPosition(DISPLAY_DEVICE* device, int x, int y);
|
||||
static KSTATUS BootFbSetCursorImage(DISPLAY_DEVICE* device, int32_t width, int32_t height, int32_t hotX, int32_t hotY, const uint32_t* argbPixels);
|
||||
static KSTATUS BootFbSetCursorPosition(DISPLAY_DEVICE* device, int32_t x, int32_t y);
|
||||
static KSTATUS BootFbShowCursor(DISPLAY_DEVICE* device, bool show);
|
||||
static KSTATUS BootFbQueryStats(DISPLAY_DEVICE* device, DISPLAY_STATS* outStats);
|
||||
|
||||
@@ -235,7 +236,7 @@ static KSTATUS KiDisplayFallbackPrintChar(char c, uint32_t fg, uint32_t bg) {
|
||||
}
|
||||
|
||||
static void KiDisplayQueueCursorWork(void) {
|
||||
if (!_InterlockedCompareExchange(&gDisplayCursorWorkInitialized, 1, 1))
|
||||
if (!NtlAtomicCompareExchange32(&gDisplayCursorWorkInitialized, 1, 1))
|
||||
return;
|
||||
if (KeIsWorkQueueStarted()) {
|
||||
(void)KeQueueWorkItem(&gDisplayCursorWorkItem);
|
||||
@@ -285,8 +286,8 @@ static void KiDisplayCursorWorker(void* context) {
|
||||
DISPLAY_DEVICE* device = (DISPLAY_DEVICE*)0;
|
||||
const DISPLAY_DEVICE_OPS* ops = (const DISPLAY_DEVICE_OPS*)0;
|
||||
uint32_t caps = 0;
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
int32_t x = 0;
|
||||
int32_t y = 0;
|
||||
bool visible = false;
|
||||
bool drawn = false;
|
||||
bool suspended = false;
|
||||
@@ -497,7 +498,7 @@ static DISPLAY_RECT KiDisplayUnionDirtyRects(const DISPLAY_RECT* a, const DISPLA
|
||||
return result;
|
||||
}
|
||||
|
||||
static void KiDisplayAddDirtyForModeLocked(const DISPLAY_MODE* mode, int x, int y, int w, int h) {
|
||||
static void KiDisplayAddDirtyForModeLocked(const DISPLAY_MODE* mode, int32_t x, int32_t y, int32_t w, int32_t h) {
|
||||
if (!mode || gDirtyAll || w <= 0 || h <= 0)
|
||||
return;
|
||||
|
||||
@@ -533,13 +534,13 @@ static void KiDisplayAddDirtyForModeLocked(const DISPLAY_MODE* mode, int x, int
|
||||
gDirtyRects[gDirtyRectCount++] = rect;
|
||||
}
|
||||
|
||||
static void KiDisplayRecordBlitLocked(const DISPLAY_MODE* mode, int x, int y, int w, int h) {
|
||||
static void KiDisplayRecordBlitLocked(const DISPLAY_MODE* mode, int32_t x, int32_t y, int32_t w, int32_t h) {
|
||||
gDisplayStats.BlitCount++;
|
||||
gDisplayStats.BytesCopied += (uint64_t)(uint32_t)w * (uint64_t)(uint32_t)h * sizeof(uint32_t);
|
||||
KiDisplayAddDirtyForModeLocked(mode, x, y, w, h);
|
||||
}
|
||||
|
||||
static void KiDisplayRecordDirectPresentLocked(const DISPLAY_MODE* mode, int x, int y, int w, int h) {
|
||||
static void KiDisplayRecordDirectPresentLocked(const DISPLAY_MODE* mode, int32_t x, int32_t y, int32_t w, int32_t h) {
|
||||
if (!mode || w <= 0 || h <= 0)
|
||||
return;
|
||||
|
||||
@@ -557,13 +558,13 @@ static void KiDisplayRecordDirectPresentLocked(const DISPLAY_MODE* mode, int x,
|
||||
gDisplayStats.BytesCopied += bytes;
|
||||
}
|
||||
|
||||
static void KiDisplayRecordFillLocked(const DISPLAY_MODE* mode, int x, int y, int w, int h) {
|
||||
static void KiDisplayRecordFillLocked(const DISPLAY_MODE* mode, int32_t x, int32_t y, int32_t w, int32_t h) {
|
||||
gDisplayStats.FillRectCount++;
|
||||
gDisplayStats.BytesCopied += (uint64_t)(uint32_t)w * (uint64_t)(uint32_t)h * sizeof(uint32_t);
|
||||
KiDisplayAddDirtyForModeLocked(mode, x, y, w, h);
|
||||
}
|
||||
|
||||
static void KiDisplayRecordCopyLocked(const DISPLAY_MODE* mode, int dstX, int dstY, int w, int h) {
|
||||
static void KiDisplayRecordCopyLocked(const DISPLAY_MODE* mode, int32_t dstX, int32_t dstY, int32_t w, int32_t h) {
|
||||
gDisplayStats.CopyRectCount++;
|
||||
gDisplayStats.BytesCopied += (uint64_t)(uint32_t)w * (uint64_t)(uint32_t)h * sizeof(uint32_t);
|
||||
KiDisplayAddDirtyForModeLocked(mode, dstX, dstY, w, h);
|
||||
@@ -656,8 +657,8 @@ static void KiDisplayRestoreCursorAfterDrawSnapshot(DISPLAY_DEVICE* device,
|
||||
if (!device || !ops || !ops->ShowCursor || !(caps & DISPLAY_CAP_SOFTWARE_CURSOR))
|
||||
return;
|
||||
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
int32_t x = 0;
|
||||
int32_t y = 0;
|
||||
bool shouldShow = false;
|
||||
uintptr_t flags = KeAcquireSpinlock(&gDisplayLock);
|
||||
shouldShow = (device == gPrimaryDisplay) &&
|
||||
@@ -719,9 +720,9 @@ static KSTATUS KiDisplayGetProviderSnapshot(DISPLAY_DEVICE** outDevice,
|
||||
|
||||
static void KiDisplayBuildGlyphPixels(char c, uint32_t fg, uint32_t bg, uint32_t* outPixels) {
|
||||
const uint8_t* glyph = Font8x16 + ((uint8_t)c * 16u);
|
||||
for (int row = 0; row < FONT_H; row++) {
|
||||
for (int32_t row = 0; row < FONT_H; row++) {
|
||||
uint8_t bits = glyph[row];
|
||||
for (int col = 0; col < FONT_W; col++)
|
||||
for (int32_t col = 0; col < FONT_W; col++)
|
||||
outPixels[row * FONT_W + col] = (bits & (0x80u >> col)) ? fg : bg;
|
||||
}
|
||||
}
|
||||
@@ -730,8 +731,8 @@ static KSTATUS KiDisplayBlitGlyphSnapshot(DISPLAY_DEVICE* device,
|
||||
const DISPLAY_DEVICE_OPS* ops,
|
||||
const DISPLAY_MODE* mode,
|
||||
char c,
|
||||
int x,
|
||||
int y,
|
||||
int32_t x,
|
||||
int32_t y,
|
||||
uint32_t fg,
|
||||
uint32_t bg) {
|
||||
if (!device || !ops || !ops->Blit || !mode)
|
||||
@@ -753,10 +754,10 @@ static KSTATUS KiDisplayBlitGlyphSnapshot(DISPLAY_DEVICE* device,
|
||||
static KSTATUS KiDisplayDrawBlitPitchedSnapshot(DISPLAY_DEVICE* device,
|
||||
const DISPLAY_DEVICE_OPS* ops,
|
||||
const DISPLAY_MODE* mode,
|
||||
int x,
|
||||
int y,
|
||||
int w,
|
||||
int h,
|
||||
int32_t x,
|
||||
int32_t y,
|
||||
int32_t w,
|
||||
int32_t h,
|
||||
const uint32_t* pixels,
|
||||
uint32_t pitchBytes) {
|
||||
if (!pixels || w <= 0 || h <= 0 || pitchBytes < (uint32_t)w * sizeof(uint32_t))
|
||||
@@ -781,10 +782,10 @@ static KSTATUS KiDisplayDrawBlitPitchedSnapshot(DISPLAY_DEVICE* device,
|
||||
static KSTATUS KiDisplayFillRectSnapshot(DISPLAY_DEVICE* device,
|
||||
const DISPLAY_DEVICE_OPS* ops,
|
||||
const DISPLAY_MODE* mode,
|
||||
int x,
|
||||
int y,
|
||||
int w,
|
||||
int h,
|
||||
int32_t x,
|
||||
int32_t y,
|
||||
int32_t w,
|
||||
int32_t h,
|
||||
uint32_t color) {
|
||||
if (w <= 0 || h <= 0)
|
||||
return NTLSTATUS_INVALID_PARAMETER;
|
||||
@@ -804,12 +805,12 @@ static KSTATUS KiDisplayFillRectSnapshot(DISPLAY_DEVICE* device,
|
||||
static KSTATUS KiDisplayCopyRectSnapshot(DISPLAY_DEVICE* device,
|
||||
const DISPLAY_DEVICE_OPS* ops,
|
||||
const DISPLAY_MODE* mode,
|
||||
int dstX,
|
||||
int dstY,
|
||||
int srcX,
|
||||
int srcY,
|
||||
int w,
|
||||
int h) {
|
||||
int32_t dstX,
|
||||
int32_t dstY,
|
||||
int32_t srcX,
|
||||
int32_t srcY,
|
||||
int32_t w,
|
||||
int32_t h) {
|
||||
if (w <= 0 || h <= 0)
|
||||
return NTLSTATUS_INVALID_PARAMETER;
|
||||
if (!device || !ops || !ops->CopyRect || !mode)
|
||||
@@ -844,7 +845,7 @@ static void KiDisplayDirtyAll(void) {
|
||||
}
|
||||
|
||||
// Implements the display Add Dirty operation.
|
||||
static void KiDisplayAddDirty(int x, int y, int w, int h) {
|
||||
static void KiDisplayAddDirty(int32_t x, int32_t y, int32_t w, int32_t h) {
|
||||
if (!KiDisplayHasDevice() || gDirtyAll || w <= 0 || h <= 0)
|
||||
return;
|
||||
|
||||
@@ -946,7 +947,7 @@ static KSTATUS KiDisplayEndDraw(void) {
|
||||
}
|
||||
|
||||
// Implements the display Draw Blit No Cursor operation.
|
||||
static KSTATUS KiDisplayDrawBlitNoCursor(int x, int y, int w, int h, const uint32_t* pixels) {
|
||||
static KSTATUS KiDisplayDrawBlitNoCursor(int32_t x, int32_t y, int32_t w, int32_t h, const uint32_t* pixels) {
|
||||
if (!pixels || w <= 0 || h <= 0)
|
||||
return NTLSTATUS_INVALID_PARAMETER;
|
||||
if (!KiDisplayHasDevice() || !gPrimaryDisplay->Ops->Blit)
|
||||
@@ -962,7 +963,7 @@ static KSTATUS KiDisplayDrawBlitNoCursor(int x, int y, int w, int h, const uint3
|
||||
}
|
||||
|
||||
// Implements the display Fill Rect No Cursor operation.
|
||||
static KSTATUS KiDisplayFillRectNoCursor(int x, int y, int w, int h, uint32_t color) {
|
||||
static KSTATUS KiDisplayFillRectNoCursor(int32_t x, int32_t y, int32_t w, int32_t h, uint32_t color) {
|
||||
if (w <= 0 || h <= 0)
|
||||
return NTLSTATUS_INVALID_PARAMETER;
|
||||
if (!KiDisplayHasDevice() || !gPrimaryDisplay->Ops->FillRect)
|
||||
@@ -978,7 +979,7 @@ static KSTATUS KiDisplayFillRectNoCursor(int x, int y, int w, int h, uint32_t co
|
||||
}
|
||||
|
||||
// Implements the display Copy Rect No Cursor operation.
|
||||
static KSTATUS KiDisplayCopyRectNoCursor(int dstX, int dstY, int srcX, int srcY, int w, int h) {
|
||||
static KSTATUS KiDisplayCopyRectNoCursor(int32_t dstX, int32_t dstY, int32_t srcX, int32_t srcY, int32_t w, int32_t h) {
|
||||
if (w <= 0 || h <= 0)
|
||||
return NTLSTATUS_INVALID_PARAMETER;
|
||||
if (!KiDisplayHasDevice() || !gPrimaryDisplay->Ops->CopyRect)
|
||||
@@ -994,7 +995,7 @@ static KSTATUS KiDisplayCopyRectNoCursor(int dstX, int dstY, int srcX, int srcY,
|
||||
}
|
||||
|
||||
// Implements the display Console Index operation.
|
||||
static size_t KiDisplayConsoleIndex(int col, int row) {
|
||||
static size_t KiDisplayConsoleIndex(int32_t col, int32_t row) {
|
||||
return (size_t)row * DISPLAY_CONSOLE_MAX_COLS + (size_t)col;
|
||||
}
|
||||
|
||||
@@ -1054,8 +1055,8 @@ static void KiDisplayConsoleScrollCellsLocked(int cols, int rows, int cellLines)
|
||||
return;
|
||||
|
||||
if (cellLines >= rows) {
|
||||
for (int y = 0; y < rows; y++) {
|
||||
for (int x = 0; x < cols; x++) {
|
||||
for (int32_t y = 0; y < rows; y++) {
|
||||
for (int32_t x = 0; x < cols; x++) {
|
||||
size_t i = KiDisplayConsoleIndex(x, y);
|
||||
gConsoleCells[i] = ' ';
|
||||
gConsoleAttrs[i] = (uint8_t)gConsoleAttribute;
|
||||
@@ -1064,8 +1065,8 @@ static void KiDisplayConsoleScrollCellsLocked(int cols, int rows, int cellLines)
|
||||
return;
|
||||
}
|
||||
|
||||
for (int y = 0; y < rows - cellLines; y++) {
|
||||
for (int x = 0; x < cols; x++) {
|
||||
for (int32_t y = 0; y < rows - cellLines; y++) {
|
||||
for (int32_t x = 0; x < cols; x++) {
|
||||
size_t dst = KiDisplayConsoleIndex(x, y);
|
||||
size_t src = KiDisplayConsoleIndex(x, y + cellLines);
|
||||
gConsoleCells[dst] = gConsoleCells[src];
|
||||
@@ -1073,8 +1074,8 @@ static void KiDisplayConsoleScrollCellsLocked(int cols, int rows, int cellLines)
|
||||
}
|
||||
}
|
||||
|
||||
for (int y = rows - cellLines; y < rows; y++) {
|
||||
for (int x = 0; x < cols; x++) {
|
||||
for (int32_t y = rows - cellLines; y < rows; y++) {
|
||||
for (int32_t x = 0; x < cols; x++) {
|
||||
size_t i = KiDisplayConsoleIndex(x, y);
|
||||
gConsoleCells[i] = ' ';
|
||||
gConsoleAttrs[i] = (uint8_t)gConsoleAttribute;
|
||||
@@ -1083,13 +1084,13 @@ static void KiDisplayConsoleScrollCellsLocked(int cols, int rows, int cellLines)
|
||||
}
|
||||
|
||||
// Implements the display Draw Char Pixels Locked operation.
|
||||
static KSTATUS KiDisplayDrawCharPixelsLocked(char c, int x, int y, uint32_t fg, uint32_t bg) {
|
||||
static KSTATUS KiDisplayDrawCharPixelsLocked(char c, int32_t x, int32_t y, uint32_t fg, uint32_t bg) {
|
||||
uint32_t glyphPixels[FONT_W * FONT_H];
|
||||
const uint8_t* glyph = Font8x16 + ((uint8_t)c * 16u);
|
||||
|
||||
for (int row = 0; row < FONT_H; row++) {
|
||||
for (int32_t row = 0; row < FONT_H; row++) {
|
||||
uint8_t bits = glyph[row];
|
||||
for (int col = 0; col < FONT_W; col++)
|
||||
for (int32_t col = 0; col < FONT_W; col++)
|
||||
glyphPixels[row * FONT_W + col] = (bits & (0x80u >> col)) ? fg : bg;
|
||||
}
|
||||
|
||||
@@ -1097,7 +1098,7 @@ static KSTATUS KiDisplayDrawCharPixelsLocked(char c, int x, int y, uint32_t fg,
|
||||
}
|
||||
|
||||
// Implements the display Draw Console Cell Locked operation.
|
||||
static KSTATUS KiDisplayDrawConsoleCellLocked(int col, int row, char c, uint16_t attr, bool updateCell) {
|
||||
static KSTATUS KiDisplayDrawConsoleCellLocked(int32_t col, int32_t row, char c, uint16_t attr, bool updateCell) {
|
||||
if (updateCell) {
|
||||
size_t i = KiDisplayConsoleIndex(col, row);
|
||||
gConsoleCells[i] = c;
|
||||
@@ -1177,7 +1178,7 @@ KSTATUS KeDisplayFlushConsoleOutput(void) {
|
||||
|
||||
// Queues the runtime display output worker when passive work is available.
|
||||
static void KiDisplayQueueOutputWorker(void) {
|
||||
if (_InterlockedCompareExchange(&gDisplayOutputWorkInitialized, 1, 1) &&
|
||||
if (NtlAtomicCompareExchange32(&gDisplayOutputWorkInitialized, 1, 1) &&
|
||||
KeIsWorkQueueStarted()) {
|
||||
(void)KeQueueWorkItem(&gDisplayOutputWorkItem);
|
||||
}
|
||||
@@ -1271,15 +1272,15 @@ void KeDisplayInitialize(const HAL_API* hal) {
|
||||
gDisplayClockLock = (SPINLOCK)SPINLOCK_INIT;
|
||||
LIST_INIT(&gDisplayClockList);
|
||||
gDisplayFrameGeneration = 0;
|
||||
_InterlockedExchange(&gDisplayClockInitialized, 1);
|
||||
NtlAtomicExchange32(&gDisplayClockInitialized, 1);
|
||||
if (!gDisplayProviderMutex)
|
||||
(void)KeMutexCreate(&gDisplayProviderMutex);
|
||||
if (!gDisplayOutputMutex)
|
||||
(void)KeMutexCreate(&gDisplayOutputMutex);
|
||||
KeInitializeWorkItem(&gDisplayCursorWorkItem, KiDisplayCursorWorker, 0);
|
||||
_InterlockedExchange(&gDisplayCursorWorkInitialized, 1);
|
||||
NtlAtomicExchange32(&gDisplayCursorWorkInitialized, 1);
|
||||
KeInitializeWorkItem(&gDisplayOutputWorkItem, KiDisplayOutputWorker, 0);
|
||||
_InterlockedExchange(&gDisplayOutputWorkInitialized, 1);
|
||||
NtlAtomicExchange32(&gDisplayOutputWorkInitialized, 1);
|
||||
gDisplayOutputRead = 0;
|
||||
gDisplayOutputWrite = 0;
|
||||
gDisplayOutputUsed = 0;
|
||||
@@ -1291,7 +1292,7 @@ void KeDisplayInitialize(const HAL_API* hal) {
|
||||
gConsoleX = 0;
|
||||
gConsoleY = 0;
|
||||
KiDisplayConsoleResetCellsLocked();
|
||||
_InterlockedExchange((volatile long*)&gDisplayConsoleSuspended, 0);
|
||||
NtlAtomicExchange32(&gDisplayConsoleSuspended, 0);
|
||||
memset(&gBootFb, 0, sizeof(gBootFb));
|
||||
memset(&gBootFbDevice, 0, sizeof(gBootFbDevice));
|
||||
|
||||
@@ -1353,7 +1354,7 @@ DISPLAY_API KSTATUS KeDisplayOpenClock(uint64_t periodMilliseconds, DISPLAY_CLOC
|
||||
return NTLSTATUS_INVALID_PARAMETER;
|
||||
*outClock = (DISPLAY_CLOCK_OBJECT*)0;
|
||||
|
||||
if (!_InterlockedCompareExchange(&gDisplayClockInitialized, 1, 1))
|
||||
if (!NtlAtomicCompareExchange32(&gDisplayClockInitialized, 1, 1))
|
||||
return NTLSTATUS_NOT_SUPPORTED;
|
||||
|
||||
uintptr_t displayFlags = KeAcquireSpinlock(&gDisplayLock);
|
||||
@@ -1429,7 +1430,7 @@ static void KiDisplaySignalFrameGeneration(uint64_t generation) {
|
||||
|
||||
// Publishes a frame-ready event from the current primary display provider.
|
||||
DISPLAY_API void KeDisplayNotifyFrame(DISPLAY_DEVICE* device) {
|
||||
if (!device || !_InterlockedCompareExchange(&gDisplayClockInitialized, 1, 1))
|
||||
if (!device || !NtlAtomicCompareExchange32(&gDisplayClockInitialized, 1, 1))
|
||||
return;
|
||||
|
||||
uintptr_t displayFlags = KeAcquireSpinlock(&gDisplayLock);
|
||||
@@ -1449,7 +1450,7 @@ DISPLAY_API void KeDisplayNotifyFrame(DISPLAY_DEVICE* device) {
|
||||
}
|
||||
|
||||
DISPLAY_API void KeDisplayTick(void) {
|
||||
if (!_InterlockedCompareExchange(&gDisplayClockInitialized, 1, 1))
|
||||
if (!NtlAtomicCompareExchange32(&gDisplayClockInitialized, 1, 1))
|
||||
return;
|
||||
|
||||
uintptr_t displayFlags = KeAcquireSpinlock(&gDisplayLock);
|
||||
@@ -1555,12 +1556,12 @@ static KSTATUS KiDisplaySeedNewPrimary(DISPLAY_DEVICE* oldDevice, DISPLAY_DEVICE
|
||||
}
|
||||
|
||||
DISPLAY_API void KeDisplaySuspendConsole(bool suspend) {
|
||||
_InterlockedExchange((volatile long*)&gDisplayConsoleSuspended, suspend ? 1 : 0);
|
||||
NtlAtomicExchange32(&gDisplayConsoleSuspended, suspend ? 1 : 0);
|
||||
}
|
||||
|
||||
// Implements the display Output Suspended operation.
|
||||
static bool KiDisplayOutputSuspended(void) {
|
||||
return _InterlockedCompareExchange((volatile long*)&gDisplayConsoleSuspended, 0, 0) != 0;
|
||||
return NtlAtomicLoad32(&gDisplayConsoleSuspended) != 0;
|
||||
}
|
||||
|
||||
DISPLAY_API KSTATUS KeDisplaySetPrimary(DISPLAY_DEVICE* device) {
|
||||
@@ -1676,7 +1677,7 @@ DISPLAY_API KSTATUS KeDisplayGetMode(DISPLAY_MODE* outMode) {
|
||||
return s;
|
||||
}
|
||||
|
||||
DISPLAY_API KSTATUS KeDisplayGetSize(int* outWidth, int* outHeight) {
|
||||
DISPLAY_API KSTATUS KeDisplayGetSize(int32_t* outWidth, int32_t* outHeight) {
|
||||
DISPLAY_MODE mode;
|
||||
KSTATUS s = KeDisplayGetMode(&mode);
|
||||
if (!KSUCCESS(s))
|
||||
@@ -1770,7 +1771,7 @@ DISPLAY_API KSTATUS KeDisplayQueryInfo(KE_DISPLAY_INFO* outInfo) {
|
||||
return NTLSTATUS_SUCCESS;
|
||||
}
|
||||
|
||||
DISPLAY_API KSTATUS KeDisplayBlit(int x, int y, int w, int h, const uint32_t* pixels) {
|
||||
DISPLAY_API KSTATUS KeDisplayBlit(int32_t x, int32_t y, int32_t w, int32_t h, const uint32_t* pixels) {
|
||||
bool providerHeld = false;
|
||||
KSTATUS s = KiDisplayAcquireProviderMutex(&providerHeld);
|
||||
if (!KSUCCESS(s))
|
||||
@@ -1792,7 +1793,7 @@ DISPLAY_API KSTATUS KeDisplayBlit(int x, int y, int w, int h, const uint32_t* pi
|
||||
return s;
|
||||
}
|
||||
|
||||
DISPLAY_API KSTATUS KeDisplayBlitPitched(int x, int y, int w, int h, const uint32_t* pixels, uint32_t pitchBytes) {
|
||||
DISPLAY_API KSTATUS KeDisplayBlitPitched(int32_t x, int32_t y, int32_t w, int32_t h, const uint32_t* pixels, uint32_t pitchBytes) {
|
||||
if (!pixels || w <= 0 || h <= 0 || pitchBytes < (uint32_t)w * sizeof(uint32_t))
|
||||
return NTLSTATUS_INVALID_PARAMETER;
|
||||
|
||||
@@ -1816,10 +1817,10 @@ DISPLAY_API KSTATUS KeDisplayBlitPitched(int x, int y, int w, int h, const uint3
|
||||
return s;
|
||||
}
|
||||
|
||||
DISPLAY_API KSTATUS KeDisplayPresentPitched(int x,
|
||||
int y,
|
||||
int w,
|
||||
int h,
|
||||
DISPLAY_API KSTATUS KeDisplayPresentPitched(int32_t x,
|
||||
int32_t y,
|
||||
int32_t w,
|
||||
int32_t h,
|
||||
const uint32_t* pixels,
|
||||
uint32_t pitchBytes) {
|
||||
if (!pixels || w <= 0 || h <= 0 || pitchBytes < (uint32_t)w * sizeof(uint32_t))
|
||||
@@ -1857,7 +1858,7 @@ DISPLAY_API KSTATUS KeDisplayPresentPitched(int x,
|
||||
return s;
|
||||
}
|
||||
|
||||
DISPLAY_API KSTATUS KeDisplayFillRect(int x, int y, int w, int h, uint32_t color) {
|
||||
DISPLAY_API KSTATUS KeDisplayFillRect(int32_t x, int32_t y, int32_t w, int32_t h, uint32_t color) {
|
||||
bool providerHeld = false;
|
||||
KSTATUS s = KiDisplayAcquireProviderMutex(&providerHeld);
|
||||
if (!KSUCCESS(s))
|
||||
@@ -1908,7 +1909,7 @@ DISPLAY_API KSTATUS KeDisplayClear(uint32_t color) {
|
||||
return s;
|
||||
}
|
||||
|
||||
DISPLAY_API KSTATUS KeDisplayCopyRect(int dstX, int dstY, int srcX, int srcY, int w, int h) {
|
||||
DISPLAY_API KSTATUS KeDisplayCopyRect(int32_t dstX, int32_t dstY, int32_t srcX, int32_t srcY, int32_t w, int32_t h) {
|
||||
bool providerHeld = false;
|
||||
KSTATUS s = KiDisplayAcquireProviderMutex(&providerHeld);
|
||||
if (!KSUCCESS(s))
|
||||
@@ -1929,7 +1930,7 @@ DISPLAY_API KSTATUS KeDisplayCopyRect(int dstX, int dstY, int srcX, int srcY, in
|
||||
return s;
|
||||
}
|
||||
|
||||
DISPLAY_API KSTATUS KeDisplayScroll(int lines) {
|
||||
DISPLAY_API KSTATUS KeDisplayScroll(int32_t lines) {
|
||||
if (lines <= 0)
|
||||
return NTLSTATUS_SUCCESS;
|
||||
|
||||
@@ -1972,7 +1973,7 @@ DISPLAY_API KSTATUS KeDisplayScroll(int lines) {
|
||||
return s;
|
||||
}
|
||||
|
||||
DISPLAY_API KSTATUS KeDisplayPutChar(char c, int x, int y, uint32_t fg, uint32_t bg) {
|
||||
DISPLAY_API KSTATUS KeDisplayPutChar(char c, int32_t x, int32_t y, uint32_t fg, uint32_t bg) {
|
||||
bool providerHeld = false;
|
||||
KSTATUS s = KiDisplayAcquireProviderMutex(&providerHeld);
|
||||
if (!KSUCCESS(s))
|
||||
@@ -2189,7 +2190,7 @@ DISPLAY_API KSTATUS KeDisplayGetConsoleInfo(KE_CONSOLE_INFO* outInfo) {
|
||||
return NTLSTATUS_SUCCESS;
|
||||
}
|
||||
|
||||
DISPLAY_API KSTATUS KeDisplaySetConsoleCursor(int col, int row) {
|
||||
DISPLAY_API KSTATUS KeDisplaySetConsoleCursor(int32_t col, int32_t row) {
|
||||
bool providerHeld = false;
|
||||
KSTATUS s = KiDisplayAcquireProviderMutex(&providerHeld);
|
||||
if (!KSUCCESS(s))
|
||||
@@ -2226,7 +2227,7 @@ DISPLAY_API KSTATUS KeDisplaySetConsoleCursor(int col, int row) {
|
||||
return NTLSTATUS_SUCCESS;
|
||||
}
|
||||
|
||||
DISPLAY_API KSTATUS KeDisplayFillConsoleChars(char c, int col, int row, size_t length, size_t* writtenOut) {
|
||||
DISPLAY_API KSTATUS KeDisplayFillConsoleChars(char c, int32_t col, int32_t row, size_t length, size_t* writtenOut) {
|
||||
if (writtenOut) *writtenOut = 0;
|
||||
|
||||
bool providerHeld = false;
|
||||
@@ -2258,8 +2259,8 @@ DISPLAY_API KSTATUS KeDisplayFillConsoleChars(char c, int col, int row, size_t l
|
||||
(void)KiDisplayHideCursorForDrawSnapshot(device, ops, caps);
|
||||
|
||||
size_t written = 0;
|
||||
int x = col;
|
||||
int y = row;
|
||||
int32_t x = col;
|
||||
int32_t y = row;
|
||||
while (written < length && y < rows) {
|
||||
uint16_t attr = DISPLAY_CONSOLE_DEFAULT_ATTR;
|
||||
uintptr_t flags = KeAcquireSpinlock(&gDisplayLock);
|
||||
@@ -2295,7 +2296,7 @@ DISPLAY_API KSTATUS KeDisplayFillConsoleChars(char c, int col, int row, size_t l
|
||||
return KSUCCESS(s) ? fs : s;
|
||||
}
|
||||
|
||||
DISPLAY_API KSTATUS KeDisplayFillConsoleAttrs(uint16_t attr, int col, int row, size_t length, size_t* writtenOut) {
|
||||
DISPLAY_API KSTATUS KeDisplayFillConsoleAttrs(uint16_t attr, int32_t col, int32_t row, size_t length, size_t* writtenOut) {
|
||||
if (writtenOut) *writtenOut = 0;
|
||||
|
||||
bool providerHeld = false;
|
||||
@@ -2327,8 +2328,8 @@ DISPLAY_API KSTATUS KeDisplayFillConsoleAttrs(uint16_t attr, int col, int row, s
|
||||
(void)KiDisplayHideCursorForDrawSnapshot(device, ops, caps);
|
||||
|
||||
size_t written = 0;
|
||||
int x = col;
|
||||
int y = row;
|
||||
int32_t x = col;
|
||||
int32_t y = row;
|
||||
while (written < length && y < rows) {
|
||||
char ch = ' ';
|
||||
uintptr_t flags = KeAcquireSpinlock(&gDisplayLock);
|
||||
@@ -2403,7 +2404,7 @@ DISPLAY_API KSTATUS KeDisplayPresent(const DISPLAY_RECT* rects, size_t rectCount
|
||||
return s;
|
||||
}
|
||||
|
||||
DISPLAY_API KSTATUS KeDisplaySetCursorImage(int width, int height, int hotX, int hotY, const uint32_t* argbPixels) {
|
||||
DISPLAY_API KSTATUS KeDisplaySetCursorImage(int32_t width, int32_t height, int32_t hotX, int32_t hotY, const uint32_t* argbPixels) {
|
||||
bool providerHeld = false;
|
||||
KSTATUS s = KiDisplayAcquireProviderMutex(&providerHeld);
|
||||
if (!KSUCCESS(s))
|
||||
@@ -2424,7 +2425,7 @@ DISPLAY_API KSTATUS KeDisplaySetCursorImage(int width, int height, int hotX, int
|
||||
return s;
|
||||
}
|
||||
|
||||
DISPLAY_API KSTATUS KeDisplaySetCursorPosition(int x, int y) {
|
||||
DISPLAY_API KSTATUS KeDisplaySetCursorPosition(int32_t x, int32_t y) {
|
||||
uintptr_t flags = KeAcquireSpinlock(&gDisplayLock);
|
||||
gCursorX = x;
|
||||
gCursorY = y;
|
||||
@@ -2588,7 +2589,7 @@ static void BootFbCopyToShadowAndScanout(uint32_t* shadow,
|
||||
}
|
||||
|
||||
// Implements the boot framebuffer pitched blit operation.
|
||||
static KSTATUS BootFbBlit(DISPLAY_DEVICE* device, int x, int y, int w, int h, const uint32_t* pixels, uint32_t pitchBytes) {
|
||||
static KSTATUS BootFbBlit(DISPLAY_DEVICE* device, int32_t x, int32_t y, int32_t w, int32_t h, const uint32_t* pixels, uint32_t pitchBytes) {
|
||||
BOOTFB_CONTEXT* fb = BootFbContext(device);
|
||||
if (!fb || !fb->Framebuffer || !pixels || w <= 0 || h <= 0 ||
|
||||
pitchBytes < (uint32_t)w * sizeof(uint32_t))
|
||||
@@ -2610,7 +2611,7 @@ static KSTATUS BootFbBlit(DISPLAY_DEVICE* device, int x, int y, int w, int h, co
|
||||
fb->Stats.BlitCount++;
|
||||
fb->Stats.BytesCopied += (uint64_t)(endX - startX) * (uint64_t)(endY - startY) * sizeof(uint32_t);
|
||||
|
||||
for (int row = 0; row < endY - startY; row++) {
|
||||
for (int32_t row = 0; row < endY - startY; row++) {
|
||||
uint32_t* dst = dstBase + ((size_t)(startY + row) * fb->Stride) + startX;
|
||||
const uint8_t* sourceRow = (const uint8_t*)pixels + (size_t)(srcOffsetY + row) * pitchBytes;
|
||||
const uint32_t* src = (const uint32_t*)sourceRow + srcOffsetX;
|
||||
@@ -2621,10 +2622,10 @@ static KSTATUS BootFbBlit(DISPLAY_DEVICE* device, int x, int y, int w, int h, co
|
||||
|
||||
// Presents one pitched source rectangle without a shadow-to-scanout second pass.
|
||||
static KSTATUS BootFbPresentPitched(DISPLAY_DEVICE* device,
|
||||
int x,
|
||||
int y,
|
||||
int w,
|
||||
int h,
|
||||
int32_t x,
|
||||
int32_t y,
|
||||
int32_t w,
|
||||
int32_t h,
|
||||
const uint32_t* pixels,
|
||||
uint32_t pitchBytes) {
|
||||
BOOTFB_CONTEXT* fb = BootFbContext(device);
|
||||
@@ -2651,7 +2652,7 @@ static KSTATUS BootFbPresentPitched(DISPLAY_DEVICE* device,
|
||||
fb->Stats.ScanoutBytes += bytes;
|
||||
fb->Stats.BytesCopied += fb->Backbuffer ? bytes * 2u : bytes;
|
||||
|
||||
for (int row = 0; row < endY - startY; row++) {
|
||||
for (int32_t row = 0; row < endY - startY; row++) {
|
||||
const uint8_t* sourceRow = (const uint8_t*)pixels + (size_t)(srcOffsetY + row) * pitchBytes;
|
||||
const uint32_t* source = (const uint32_t*)sourceRow + srcOffsetX;
|
||||
uint32_t* scanout = fb->Framebuffer + ((size_t)(startY + row) * fb->Stride) + startX;
|
||||
@@ -2668,7 +2669,7 @@ static KSTATUS BootFbPresentPitched(DISPLAY_DEVICE* device,
|
||||
}
|
||||
|
||||
// Implements the boot Fb Fill Rect operation.
|
||||
static KSTATUS BootFbFillRect(DISPLAY_DEVICE* device, int x, int y, int w, int h, uint32_t color) {
|
||||
static KSTATUS BootFbFillRect(DISPLAY_DEVICE* device, int32_t x, int32_t y, int32_t w, int32_t h, uint32_t color) {
|
||||
BOOTFB_CONTEXT* fb = BootFbContext(device);
|
||||
if (!fb || !fb->Framebuffer || w <= 0 || h <= 0)
|
||||
return NTLSTATUS_INVALID_PARAMETER;
|
||||
@@ -2694,7 +2695,7 @@ static KSTATUS BootFbFillRect(DISPLAY_DEVICE* device, int x, int y, int w, int h
|
||||
}
|
||||
|
||||
// Implements the boot Fb Copy Rect operation.
|
||||
static KSTATUS BootFbCopyRect(DISPLAY_DEVICE* device, int dstX, int dstY, int srcX, int srcY, int w, int h) {
|
||||
static KSTATUS BootFbCopyRect(DISPLAY_DEVICE* device, int32_t dstX, int32_t dstY, int32_t srcX, int32_t srcY, int32_t w, int32_t h) {
|
||||
BOOTFB_CONTEXT* fb = BootFbContext(device);
|
||||
if (!fb || !fb->Framebuffer || w <= 0 || h <= 0)
|
||||
return NTLSTATUS_INVALID_PARAMETER;
|
||||
@@ -2717,13 +2718,13 @@ static KSTATUS BootFbCopyRect(DISPLAY_DEVICE* device, int dstX, int dstY, int sr
|
||||
|
||||
size_t rowBytes = (size_t)w * sizeof(uint32_t);
|
||||
if (dstY > srcY) {
|
||||
for (int row = h - 1; row >= 0; row--) {
|
||||
for (int32_t row = h - 1; row >= 0; row--) {
|
||||
uint32_t* dst = base + ((size_t)(dstY + row) * fb->Stride) + dstX;
|
||||
uint32_t* src = base + ((size_t)(srcY + row) * fb->Stride) + srcX;
|
||||
memmove(dst, src, rowBytes);
|
||||
}
|
||||
} else {
|
||||
for (int row = 0; row < h; row++) {
|
||||
for (int32_t row = 0; row < h; row++) {
|
||||
uint32_t* dst = base + ((size_t)(dstY + row) * fb->Stride) + dstX;
|
||||
uint32_t* src = base + ((size_t)(srcY + row) * fb->Stride) + srcX;
|
||||
memmove(dst, src, rowBytes);
|
||||
@@ -2733,7 +2734,7 @@ static KSTATUS BootFbCopyRect(DISPLAY_DEVICE* device, int dstX, int dstY, int sr
|
||||
}
|
||||
|
||||
// Implements the boot Fb Read Rect operation.
|
||||
static KSTATUS BootFbReadRect(DISPLAY_DEVICE* device, int x, int y, int w, int h, uint32_t* outPixels, uint32_t outStride) {
|
||||
static KSTATUS BootFbReadRect(DISPLAY_DEVICE* device, int32_t x, int32_t y, int32_t w, int32_t h, uint32_t* outPixels, uint32_t outStride) {
|
||||
BOOTFB_CONTEXT* fb = BootFbContext(device);
|
||||
if (!fb || !fb->Framebuffer || !outPixels || outStride == 0 || w <= 0 || h <= 0)
|
||||
return NTLSTATUS_INVALID_PARAMETER;
|
||||
@@ -2749,7 +2750,7 @@ static KSTATUS BootFbReadRect(DISPLAY_DEVICE* device, int x, int y, int w, int h
|
||||
|
||||
int dstOffsetX = r.X - x;
|
||||
int dstOffsetY = r.Y - y;
|
||||
for (int row = 0; row < r.H; row++) {
|
||||
for (int32_t row = 0; row < r.H; row++) {
|
||||
const uint32_t* src = srcBase + ((size_t)(r.Y + row) * fb->Stride) + r.X;
|
||||
uint32_t* dst = outPixels + ((size_t)(dstOffsetY + row) * outStride) + dstOffsetX;
|
||||
memcpy(dst, src, (size_t)r.W * sizeof(uint32_t));
|
||||
@@ -2782,7 +2783,7 @@ static KSTATUS BootFbPresent(DISPLAY_DEVICE* device, const DISPLAY_RECT* rects,
|
||||
fb->Stats.BytesCopied += bytes;
|
||||
fb->Stats.ScanoutBytes += bytes;
|
||||
size_t pixelCount = (size_t)r.W;
|
||||
for (int row = 0; row < r.H; row++) {
|
||||
for (int32_t row = 0; row < r.H; row++) {
|
||||
uint32_t* dst = fb->Framebuffer + ((size_t)(r.Y + row) * fb->Stride) + r.X;
|
||||
uint32_t* src = fb->Backbuffer + ((size_t)(r.Y + row) * fb->Stride) + r.X;
|
||||
BootFbCopyToScanout(dst, src, pixelCount);
|
||||
@@ -2800,7 +2801,7 @@ static KSTATUS BootFbSync(DISPLAY_DEVICE* device) {
|
||||
}
|
||||
|
||||
// Implements the boot Fb Set Cursor Image operation.
|
||||
static KSTATUS BootFbSetCursorImage(DISPLAY_DEVICE* device, int width, int height, int hotX, int hotY, const uint32_t* argbPixels) {
|
||||
static KSTATUS BootFbSetCursorImage(DISPLAY_DEVICE* device, int32_t width, int32_t height, int32_t hotX, int32_t hotY, const uint32_t* argbPixels) {
|
||||
(void)device;
|
||||
(void)width;
|
||||
(void)height;
|
||||
@@ -2811,7 +2812,7 @@ static KSTATUS BootFbSetCursorImage(DISPLAY_DEVICE* device, int width, int heigh
|
||||
}
|
||||
|
||||
// Implements the boot Fb Set Cursor Position operation.
|
||||
static KSTATUS BootFbSetCursorPosition(DISPLAY_DEVICE* device, int x, int y) {
|
||||
static KSTATUS BootFbSetCursorPosition(DISPLAY_DEVICE* device, int32_t x, int32_t y) {
|
||||
BOOTFB_CONTEXT* fb = BootFbContext(device);
|
||||
if (fb) fb->Stats.CursorMoveCount++;
|
||||
(void)x;
|
||||
@@ -2846,7 +2847,7 @@ static void BootFbRestoreCursor(BOOTFB_CONTEXT* fb) {
|
||||
DISPLAY_RECT r = { gCursorDrawX, gCursorDrawY, DISPLAY_CURSOR_W, DISPLAY_CURSOR_H };
|
||||
DISPLAY_MODE mode = { fb->Width, fb->Height, fb->Stride, DisplayPixelFormatX8R8G8B8 };
|
||||
if (KiDisplayClipRect(&mode, &r)) {
|
||||
for (int row = 0; row < r.H; row++) {
|
||||
for (int32_t row = 0; row < r.H; row++) {
|
||||
uint32_t* dst = fb->Framebuffer + ((size_t)(r.Y + row) * fb->Stride) + r.X;
|
||||
uint32_t* src = fb->Backbuffer + ((size_t)(r.Y + row) * fb->Stride) + r.X;
|
||||
memcpy(dst, src, (size_t)r.W * sizeof(uint32_t));
|
||||
@@ -2859,18 +2860,18 @@ static void BootFbRestoreCursor(BOOTFB_CONTEXT* fb) {
|
||||
}
|
||||
|
||||
// Implements the boot Fb Draw Cursor operation.
|
||||
static void BootFbDrawCursor(BOOTFB_CONTEXT* fb, int x, int y) {
|
||||
static void BootFbDrawCursor(BOOTFB_CONTEXT* fb, int32_t x, int32_t y) {
|
||||
if (!fb || !fb->Framebuffer || !fb->Backbuffer)
|
||||
return;
|
||||
|
||||
gCursorDrawX = x;
|
||||
gCursorDrawY = y;
|
||||
|
||||
for (int row = 0; row < DISPLAY_CURSOR_H; row++) {
|
||||
for (int32_t row = 0; row < DISPLAY_CURSOR_H; row++) {
|
||||
int fy = y + row;
|
||||
if ((unsigned)fy >= fb->Height)
|
||||
continue;
|
||||
for (int col = 0; col < DISPLAY_CURSOR_W; col++) {
|
||||
for (int32_t col = 0; col < DISPLAY_CURSOR_W; col++) {
|
||||
int fx = x + col;
|
||||
if ((unsigned)fx >= fb->Width)
|
||||
continue;
|
||||
|
||||
Reference in new issue
Block a user