Skip to content

Instantly share code, notes, and snippets.

@aaronp24
Created September 22, 2016 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronp24/2d9edefc168adb02d25b81f62a5409b1 to your computer and use it in GitHub Desktop.
Save aaronp24/2d9edefc168adb02d25b81f62a5409b1 to your computer and use it in GitHub Desktop.
void NV_API_CALL os_get_screen_info(
NvU64 *pPhysicalAddress,
NvU16 *pFbWidth,
NvU16 *pFbHeight,
NvU16 *pFbDepth,
NvU16 *pFbPitch
)
{
const sc_softc_t *sc = sc_get_softc(0, SC_KERNEL_CONSOLE);
if (sc)
{
const video_adapter_t *adp = sc->adp;
if (adp)
{
const struct video_info *vi = &adp->va_info;
if (vi && (vi->vi_flags & V_INFO_LINEAR))
{
*pPhysicalAddress = vi->vi_buffer;
*pFbWidth = vi->vi_width;
*pFbHeight = vi->vi_height;
*pFbDepth = vi->vi_depth;
*pFbPitch = adp->va_line_width;
return;
}
}
}
*pPhysicalAddress = 0;
*pFbWidth = *pFbHeight = *pFbDepth = *pFbPitch = 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment