70 lines
2.2 KiB
C
70 lines
2.2 KiB
C
// Public NTLite display ABI declarations shared between kernel, drivers, and user mode.
|
|
|
|
#pragma once
|
|
// display.h - display device DDI
|
|
|
|
// Display providers register DISPLAY_DEVICE objects with the kernel display
|
|
// manager. The boot framebuffer backend is registered by the kernel itself;
|
|
// PCI/virtual GPU drivers register additional providers later.
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
#include <stddef.h>
|
|
#include <ntlite/status.h>
|
|
|
|
#ifndef DISPLAY_API
|
|
#define DISPLAY_API __declspec(dllimport)
|
|
#endif
|
|
|
|
#include <ntlite/display.h>
|
|
|
|
typedef struct DISPLAY_DEVICE DISPLAY_DEVICE;
|
|
|
|
typedef struct DISPLAY_DEVICE_OPS {
|
|
KSTATUS (*GetMode)(DISPLAY_DEVICE* device, DISPLAY_MODE* outMode);
|
|
|
|
KSTATUS (*Blit)(DISPLAY_DEVICE* device,
|
|
int x, int y, int w, int h,
|
|
const uint32_t* pixels);
|
|
|
|
KSTATUS (*FillRect)(DISPLAY_DEVICE* device,
|
|
int x, int y, int w, int h,
|
|
uint32_t color);
|
|
|
|
KSTATUS (*CopyRect)(DISPLAY_DEVICE* device,
|
|
int dstX, int dstY,
|
|
int srcX, int srcY,
|
|
int w, int h);
|
|
|
|
KSTATUS (*ReadRect)(DISPLAY_DEVICE* device,
|
|
int x, int y, int w, int h,
|
|
uint32_t* outPixels, uint32_t outStride);
|
|
|
|
KSTATUS (*Present)(DISPLAY_DEVICE* device,
|
|
const DISPLAY_RECT* rects,
|
|
size_t rectCount);
|
|
|
|
KSTATUS (*Sync)(DISPLAY_DEVICE* device);
|
|
|
|
KSTATUS (*SetCursorImage)(DISPLAY_DEVICE* device,
|
|
int width, int height,
|
|
int hotX, int hotY,
|
|
const uint32_t* argbPixels);
|
|
|
|
KSTATUS (*SetCursorPosition)(DISPLAY_DEVICE* device, int x, int y);
|
|
KSTATUS (*ShowCursor)(DISPLAY_DEVICE* device, bool show);
|
|
|
|
KSTATUS (*QueryStats)(DISPLAY_DEVICE* device, DISPLAY_STATS* outStats);
|
|
} DISPLAY_DEVICE_OPS;
|
|
|
|
struct DISPLAY_DEVICE {
|
|
const char* Name;
|
|
uint32_t Caps;
|
|
void* DriverContext;
|
|
const DISPLAY_DEVICE_OPS* Ops;
|
|
DISPLAY_DEVICE* Next;
|
|
};
|
|
|
|
DISPLAY_API KSTATUS KeDisplayRegisterDevice(DISPLAY_DEVICE* device);
|
|
DISPLAY_API KSTATUS KeDisplaySetPrimary(DISPLAY_DEVICE* device);
|