internal HardwareDisplayDriver(string devicePath) { DevicePath = devicePath; _handle = UnsafeNativeMethods.Open(DevicePath, 0, UnixFileMode.WriteOnly); _vinfo = GetVarScreenInfo(); _finfo = GetFixedScreenInfo(); VisibleWidth = (int)_vinfo.VisibleResolutionX; VisibleHeight = (int)_vinfo.VisibleResolutionY; VirtualWidth = (int)_vinfo.VirtualResolutionX; VirtualHeight = (int)_vinfo.VirtualResolutionY; Framebuffer = new HardwareFramebuffer(devicePath, VisibleWidth, VisibleHeight, VirtualWidth, VirtualHeight); _vinfo.AccelFlags = 0x01; _vinfo.Width = 0xFFFFFFFF; _vinfo.Height = 0xFFFFFFFF; _vinfo.Rotate = 1; _vinfo.PixClock = 160000000; _vinfo.VisibleResolutionX = 1872; _vinfo.VisibleResolutionY = 1404; _vinfo.LeftMargin = 32; _vinfo.RightMargin = 326; _vinfo.UpperMargin = 4; _vinfo.LowerMargin = 12; _vinfo.HSyncLen = 44; _vinfo.VSyncLen = 1; _vinfo.Sync = FbSync.None; _vinfo.VMode = FbVMode.NonInterlaced; _vinfo.BitsPerPixel = sizeof(short) * 8; _vinfo.AccelFlags = 0; PutVarScreenInfo(_vinfo); }
/// <summary> /// Reads fixed device information from the display /// </summary> /// <returns>A populated <see cref="FbFixedScreenInfo" /></returns> public FbFixedScreenInfo GetFixedScreenInfo() { var finfo = new FbFixedScreenInfo(); if (DisplayIoctl.Ioctl(_handle, IoctlDisplayCommand.GetFixedScreenInfo, ref finfo) == -1) { throw new UnixException(); } return(finfo); }
public static extern int Ioctl(SafeUnixHandle handle, IoctlDisplayCommand request, ref FbFixedScreenInfo data);