Skip to content

Commit 790b25f

Browse files
committed
Minor rename: KernelStateInfo.gx_back -> gx_backfb
1 parent fc612e5 commit 790b25f

File tree

4 files changed

+24
-23
lines changed

4 files changed

+24
-23
lines changed

include/compositor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ typedef struct Window {
2929
#define WINMAN_GRID_COLS_MAX (2U)
3030
#define WINMAN_GRID_CELL_COUNT (WINMAN_GRID_ROWS_MAX * WINMAN_GRID_COLS_MAX)
3131

32-
#define WINMAN_GRID_CELL_WIDTH_PX() (g_kstate.gx_back.width_px / WINMAN_GRID_COLS_MAX)
33-
#define WINMAN_GRID_CELL_HEIGHT_PX() (g_kstate.gx_back.height_px / WINMAN_GRID_ROWS_MAX)
32+
#define WINMAN_GRID_CELL_WIDTH_PX() (g_kstate.gx_backfb.width_px / WINMAN_GRID_COLS_MAX)
33+
#define WINMAN_GRID_CELL_HEIGHT_PX() (g_kstate.gx_backfb.height_px / WINMAN_GRID_ROWS_MAX)
3434

3535
// Window grid coordiate of rows and columns to screen coordinates
3636
#define WINMAN_GRID_CELL_Y(r) (WINMAN_GRID_CELL_HEIGHT_PX() * r)

include/kernel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ typedef struct KernelStateInfo {
3333
U32 tick_count; // incremented every CONFIG_TICK_PERIOD_MICROSEC micro seconds.
3434
#ifdef GRAPHICS_MODE_ENABLED
3535
// Kernel Graphics back buffer
36-
KGraphicsArea gx_back;
36+
KGraphicsArea gx_backfb;
3737
// HW Video Framebuffer
3838
KGraphicsArea gx_hwfb;
3939
#endif

src/kernel/compositor.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
static SIZE getWindowAreaSizeBytes()
3838
{
3939
return WINMAN_GRID_CELL_WIDTH_PX() * WINMAN_GRID_CELL_HEIGHT_PX() *
40-
g_kstate.gx_back.bytesPerPixel;
40+
g_kstate.gx_backfb.bytesPerPixel;
4141
}
4242

4343
static ListNode windowsListHead;
@@ -92,11 +92,11 @@ static void drawWindowDecorations (const KGraphicsArea* wa, const char* title)
9292
static Window* allocWindow (UINT processID, UINT screen_x, UINT screen_y)
9393
{
9494
// Create new window graphics area
95-
KGraphicsArea windowArea = { .bytesPerPixel = g_kstate.gx_back.bytesPerPixel,
95+
KGraphicsArea windowArea = { .bytesPerPixel = g_kstate.gx_backfb.bytesPerPixel,
9696
.width_px = WINMAN_GRID_CELL_WIDTH_PX(),
9797
.height_px = WINMAN_GRID_CELL_HEIGHT_PX(),
9898
.bytesPerRow = WINMAN_GRID_CELL_WIDTH_PX() *
99-
g_kstate.gx_back.bytesPerPixel };
99+
g_kstate.gx_backfb.bytesPerPixel };
100100

101101
VMemoryManager* vmm = kprocess_getCurrentContext();
102102
SIZE bufferSzPages = BYTES_TO_PAGEFRAMES_CEILING (getWindowAreaSizeBytes());
@@ -208,8 +208,9 @@ void kcompose_flush()
208208
FUNC_ENTRY();
209209

210210
KERNEL_PHASE_VALIDATE (KERNEL_PHASE_STATE_GRAPHICS_READY);
211-
KGraphicsArea* backbuffer = (KGraphicsArea*)&g_kstate.gx_back;
212-
kgraphics_rect (backbuffer, 0, 0, backbuffer->width_px, backbuffer->height_px, DESKTOP_BG_COLOR);
211+
KGraphicsArea* backbuffer = (KGraphicsArea*)&g_kstate.gx_backfb;
212+
kgraphics_rect (backbuffer, 0, 0, backbuffer->width_px, backbuffer->height_px,
213+
DESKTOP_BG_COLOR);
213214

214215
ListNode* node;
215216
list_for_each (&windowsListHead, node)

src/kernel/kgraphics.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ void kgraphics_blit (const KGraphicsArea* destg, UINT x, UINT y, const KGraphics
145145
}
146146
}
147147

148-
void kgraphics_image_raw (const KGraphicsArea* g, UINT x, UINT y, UINT w, UINT h, UINT bytesPerPixel,
149-
U8* bytes)
148+
void kgraphics_image_raw (const KGraphicsArea* g, UINT x, UINT y, UINT w, UINT h,
149+
UINT bytesPerPixel, U8* bytes)
150150
{
151151
FUNC_ENTRY ("area: %px, x: %u, y: %u, w: %u, h: %u, bytes: %px", g, x, y, w, h, bytes);
152152

@@ -219,21 +219,21 @@ bool kgraphics_init()
219219
kvmm_setAddressSpaceMetadata (g_kstate.context, (PTR)framebuffer, "vesafb", NULL);
220220

221221
// Backbuffer: Store a copy of basic/global graphics mode information.
222-
g_kstate.gx_back.bytesPerPixel = gxi.bytesPerPixel;
223-
g_kstate.gx_back.bytesPerRow = gxi.bytesPerScanLine;
224-
g_kstate.gx_back.width_px = gxi.xResolution;
225-
g_kstate.gx_back.height_px = gxi.yResolution;
226-
g_kstate.gx_back.bufferSizeBytes = PAGEFRAMES_TO_BYTES (szPages);
227-
if (!(g_kstate.gx_back.buffer = (U8*)
222+
g_kstate.gx_backfb.bytesPerPixel = gxi.bytesPerPixel;
223+
g_kstate.gx_backfb.bytesPerRow = gxi.bytesPerScanLine;
224+
g_kstate.gx_backfb.width_px = gxi.xResolution;
225+
g_kstate.gx_backfb.height_px = gxi.yResolution;
226+
g_kstate.gx_backfb.bufferSizeBytes = PAGEFRAMES_TO_BYTES (szPages);
227+
if (!(g_kstate.gx_backfb.buffer = (U8*)
228228
kvmm_memmap (g_kstate.context, 0, NULL, szPages,
229229
VMM_MEMMAP_FLAG_IMMCOMMIT | VMM_MEMMAP_FLAG_KERNEL_PAGE, NULL))) {
230230
RETURN_ERROR (ERROR_PASSTHROUGH, false);
231231
}
232-
kvmm_setAddressSpaceMetadata (g_kstate.context, (PTR)g_kstate.gx_back.buffer, "gxbackbuffer",
232+
kvmm_setAddressSpaceMetadata (g_kstate.context, (PTR)g_kstate.gx_backfb.buffer, "gxbackbuffer",
233233
NULL);
234234

235235
// HW Framebuffer: Store a copy of basic/global graphics mode information.
236-
g_kstate.gx_hwfb = g_kstate.gx_back;
236+
g_kstate.gx_hwfb = g_kstate.gx_backfb;
237237
g_kstate.gx_hwfb.buffer = (U8*)framebuffer;
238238

239239
KERNEL_PHASE_SET (KERNEL_PHASE_STATE_GRAPHICS_READY);
@@ -246,14 +246,14 @@ void kgraphis_flush()
246246
return; // Graphics mode is not ready
247247
}
248248

249-
KGraphicsArea* backbuffer = (KGraphicsArea*)&g_kstate.gx_back;
249+
KGraphicsArea* backbuffer = (KGraphicsArea*)&g_kstate.gx_backfb;
250250

251251
// Backbuffer must exactly match the vesa framebuffer
252252
k_assert (backbuffer != NULL && (void*)framebuffer != NULL, "Graphics buffers cannot be NULL");
253-
k_assert (g_kstate.gx_back.bytesPerRow == gxi.bytesPerScanLine, "Invalid backbuffer");
254-
k_assert (g_kstate.gx_back.bytesPerPixel == gxi.bytesPerPixel, "Invalid backbuffer");
255-
k_assert (g_kstate.gx_back.width_px == gxi.xResolution, "Invalid backbuffer");
256-
k_assert (g_kstate.gx_back.height_px == gxi.yResolution, "Invalid backbuffer");
253+
k_assert (g_kstate.gx_backfb.bytesPerRow == gxi.bytesPerScanLine, "Invalid backbuffer");
254+
k_assert (g_kstate.gx_backfb.bytesPerPixel == gxi.bytesPerPixel, "Invalid backbuffer");
255+
k_assert (g_kstate.gx_backfb.width_px == gxi.xResolution, "Invalid backbuffer");
256+
k_assert (g_kstate.gx_backfb.height_px == gxi.yResolution, "Invalid backbuffer");
257257

258258
arch_waitForNextVerticalRetrace();
259259
draw_cursor (backbuffer);

0 commit comments

Comments
 (0)