Lines Matching refs:pScrn
67 static void AdjustFrame(ScrnInfoPtr pScrn, int x, int y);
69 static Bool EnterVT(ScrnInfoPtr pScrn);
72 static ModeStatus ValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode,
74 static void FreeScreen(ScrnInfoPtr pScrn);
75 static void LeaveVT(ScrnInfoPtr pScrn);
76 static Bool SwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode);
78 static Bool PreInit(ScrnInfoPtr pScrn, int flags);
521 GetRec(ScrnInfoPtr pScrn) in GetRec() argument
523 if (pScrn->driverPrivate) in GetRec()
526 pScrn->driverPrivate = xnfcalloc(sizeof(modesettingRec), 1); in GetRec()
721 ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); in msBlockHandler() local
722 xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); in msBlockHandler()
755 drmmode_set_desired_modes(pScrn, &ms->drmmode, TRUE, FALSE); in msBlockHandler()
767 ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); in msBlockHandler_oneshot() local
768 modesettingPtr ms = modesettingPTR(pScrn); in msBlockHandler_oneshot()
773 drmmode_set_desired_modes(pScrn, &ms->drmmode, TRUE, FALSE); in msBlockHandler_oneshot()
777 FreeRec(ScrnInfoPtr pScrn) in FreeRec() argument
781 if (!pScrn) in FreeRec()
784 ms = modesettingPTR(pScrn); in FreeRec()
792 ms_ent = ms_ent_priv(pScrn); in FreeRec()
807 pScrn->driverPrivate = NULL; in FreeRec()
814 try_enable_exa(ScrnInfoPtr pScrn) in try_enable_exa() argument
816 modesettingPtr ms = modesettingPTR(pScrn); in try_enable_exa()
818 if (xf86LoadSubModule(pScrn, "exa")) in try_enable_exa()
819 ms_init_exa(pScrn); in try_enable_exa()
822 xf86DrvMsg(pScrn->scrnIndex, X_INFO, "exa initialized\n"); in try_enable_exa()
824 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "exa initialization failed\n"); in try_enable_exa()
828 try_enable_glamor(ScrnInfoPtr pScrn) in try_enable_glamor() argument
830 modesettingPtr ms = modesettingPTR(pScrn); in try_enable_glamor()
840 xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Cannot use glamor with 24bpp packed fb\n"); in try_enable_glamor()
845 xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "glamor disabled\n"); in try_enable_glamor()
849 if (xf86LoadSubModule(pScrn, GLAMOR_EGL_MODULE_NAME)) { in try_enable_glamor()
850 if (glamor_egl_init(pScrn, ms->fd)) { in try_enable_glamor()
851 xf86DrvMsg(pScrn->scrnIndex, X_INFO, "glamor initialized\n"); in try_enable_glamor()
854 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, in try_enable_glamor()
858 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, in try_enable_glamor()
863 xf86DrvMsg(pScrn->scrnIndex, X_INFO, in try_enable_glamor()
870 msShouldDoubleShadow(ScrnInfoPtr pScrn, modesettingPtr ms) in msShouldDoubleShadow() argument
893 xf86DrvMsg(pScrn->scrnIndex, from, in msShouldDoubleShadow()
900 ms_get_drm_master_fd(ScrnInfoPtr pScrn) in ms_get_drm_master_fd() argument
906 ms = modesettingPTR(pScrn); in ms_get_drm_master_fd()
907 ms_ent = ms_ent_priv(pScrn); in ms_get_drm_master_fd()
912 xf86DrvMsg(pScrn->scrnIndex, X_INFO, in ms_get_drm_master_fd()
972 PreInit(ScrnInfoPtr pScrn, int flags) in PreInit() argument
983 if (pScrn->numEntities != 1) in PreInit()
991 if (!GetRec(pScrn)) in PreInit()
994 pEnt = xf86GetEntityInfo(pScrn->entityList[0]); in PreInit()
996 ms = modesettingPTR(pScrn); in PreInit()
1000 pScrn->displayWidth = 640; /* default it */ in PreInit()
1002 if (xf86IsEntityShared(pScrn->entityList[0])) { in PreInit()
1003 if (xf86IsPrimInitDone(pScrn->entityList[0])) in PreInit()
1006 xf86SetPrimInitDone(pScrn->entityList[0]); in PreInit()
1009 pScrn->monitor = pScrn->confScreen->monitor; in PreInit()
1010 pScrn->progClock = TRUE; in PreInit()
1011 pScrn->rgbBits = 8; in PreInit()
1013 if (!ms_get_drm_master_fd(pScrn)) in PreInit()
1020 drmmode_get_default_bpp(pScrn, &ms->drmmode, &defaultdepth, &defaultbpp); in PreInit()
1024 xf86DrvMsg(pScrn->scrnIndex, X_INFO, in PreInit()
1033 (pScrn, defaultdepth, defaultdepth, defaultbpp, bppflags)) in PreInit()
1036 switch (pScrn->depth) { in PreInit()
1043 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, in PreInit()
1045 pScrn->depth); in PreInit()
1048 xf86PrintDepthBpp(pScrn); in PreInit()
1050 ms->drmmode.kbpp = pScrn->bitsPerPixel; in PreInit()
1053 xf86CollectOptions(pScrn, NULL); in PreInit()
1057 xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, ms->drmmode.Options); in PreInit()
1059 if (!xf86SetWeight(pScrn, defaultWeight, defaultWeight)) in PreInit()
1061 if (!xf86SetDefaultVisual(pScrn, -1)) in PreInit()
1079 try_enable_glamor(pScrn); in PreInit()
1098 xf86DrvMsg(pScrn->scrnIndex, X_INFO, in PreInit()
1104 ms->drmmode.shadow_enable2 = msShouldDoubleShadow(pScrn, ms); in PreInit()
1129 xf86DrvMsg(pScrn->scrnIndex, X_INFO, in PreInit()
1134 pScrn->capabilities = 0; in PreInit()
1138 pScrn->capabilities |= RR_Capability_SinkOutput; in PreInit()
1140 pScrn->capabilities |= RR_Capability_SinkOffload; in PreInit()
1144 pScrn->capabilities |= RR_Capability_SourceOutput | RR_Capability_SourceOffload; in PreInit()
1176 if (drmmode_pre_init(pScrn, &ms->drmmode, pScrn->bitsPerPixel / 8) == FALSE) { in PreInit()
1177 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "KMS setup failed\n"); in PreInit()
1187 if (!xf86SetGamma(pScrn, zeros)) { in PreInit()
1192 if (!(pScrn->is_gpu && connector_count == 0) && pScrn->modes == NULL) { in PreInit()
1193 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No modes.\n"); in PreInit()
1197 pScrn->currentMode = pScrn->modes; in PreInit()
1200 xf86SetDpi(pScrn, 0, 0); in PreInit()
1203 if (!xf86LoadSubModule(pScrn, "fb")) { in PreInit()
1208 if (!xf86LoadSubModule(pScrn, "shadow")) { in PreInit()
1222 ScrnInfoPtr pScrn = xf86ScreenToScrn(screen); in msShadowWindow() local
1223 modesettingPtr ms = modesettingPTR(pScrn); in msShadowWindow()
1226 stride = (pScrn->displayWidth * ms->drmmode.kbpp) / 8; in msShadowWindow()
1270 ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); in msUpdatePacked() local
1271 modesettingPtr ms = modesettingPTR(pScrn); in msUpdatePacked()
1272 Bool use_3224 = ms->drmmode.force_24_32 && pScrn->bitsPerPixel == 32; in msUpdatePacked()
1467 ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); in CreateScreenResources() local
1468 modesettingPtr ms = modesettingPTR(pScrn); in CreateScreenResources()
1478 if (!drmmode_set_desired_modes(pScrn, &ms->drmmode, pScrn->is_gpu, FALSE)) in CreateScreenResources()
1484 drmmode_uevent_init(pScrn, &ms->drmmode); in CreateScreenResources()
1487 drmmode_map_cursor_bos(pScrn, &ms->drmmode); in CreateScreenResources()
1503 …ms->drmmode.shadow_fb2 = calloc(1, pScrn->displayWidth * pScrn->virtualY * ((pScrn->bitsPerPixel +… in CreateScreenResources()
1526 xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Damage tracking initialized\n"); in CreateScreenResources()
1529 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, in CreateScreenResources()
1648 SetMaster(ScrnInfoPtr pScrn) in SetMaster() argument
1650 modesettingPtr ms = modesettingPTR(pScrn); in SetMaster()
1664 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "drmSetMaster failed: %s\n", in SetMaster()
1677 ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); in CreateWindow_oneshot() local
1678 modesettingPtr ms = modesettingPTR(pScrn); in CreateWindow_oneshot()
1685 drmmode_copy_fb(pScrn, &ms->drmmode); in CreateWindow_oneshot()
1692 ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); in ScreenInit() local
1693 modesettingPtr ms = modesettingPTR(pScrn); in ScreenInit()
1697 pScrn->pScreen = pScreen; in ScreenInit()
1700 if (!SetMaster(pScrn)) in ScreenInit()
1710 pScrn->displayWidth = pScrn->virtualX; in ScreenInit()
1711 if (!drmmode_create_initial_bos(pScrn, &ms->drmmode)) in ScreenInit()
1717 pScrn->displayWidth * pScrn->virtualY * in ScreenInit()
1718 ((pScrn->bitsPerPixel + 7) >> 3)); in ScreenInit()
1725 if (!miSetVisualTypes(pScrn->depth, in ScreenInit()
1726 miGetDefaultVisualMask(pScrn->depth), in ScreenInit()
1727 pScrn->rgbBits, pScrn->defaultVisual)) in ScreenInit()
1739 pScrn->memPhysBase = 0; in ScreenInit()
1740 pScrn->fbOffset = 0; in ScreenInit()
1743 pScrn->virtualX, pScrn->virtualY, in ScreenInit()
1744 pScrn->xDpi, pScrn->yDpi, in ScreenInit()
1745 pScrn->displayWidth, pScrn->bitsPerPixel)) in ScreenInit()
1748 if (pScrn->bitsPerPixel > 8) { in ScreenInit()
1753 visual->offsetRed = pScrn->offset.red; in ScreenInit()
1754 visual->offsetGreen = pScrn->offset.green; in ScreenInit()
1755 visual->offsetBlue = pScrn->offset.blue; in ScreenInit()
1756 visual->redMask = pScrn->mask.red; in ScreenInit()
1757 visual->greenMask = pScrn->mask.green; in ScreenInit()
1758 visual->blueMask = pScrn->mask.blue; in ScreenInit()
1765 if (drmmode_init(pScrn, &ms->drmmode) == FALSE) { in ScreenInit()
1766 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, in ScreenInit()
1772 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "shadow fb init failed\n"); in ScreenInit()
1784 try_enable_exa(pScrn); in ScreenInit()
1814 pScrn->vtSema = TRUE; in ScreenInit()
1843 if (!drmmode_setup_colormap(pScreen, pScrn)) in ScreenInit()
1857 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, in ScreenInit()
1868 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, in ScreenInit()
1874 xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); in ScreenInit()
1877 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, in ScreenInit()
1884 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, in ScreenInit()
1889 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, in ScreenInit()
1913 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, in ScreenInit()
1923 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, in ScreenInit()
1928 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, in ScreenInit()
1935 pScrn->vtSema = TRUE; in ScreenInit()
1941 AdjustFrame(ScrnInfoPtr pScrn, int x, int y) in AdjustFrame() argument
1943 modesettingPtr ms = modesettingPTR(pScrn); in AdjustFrame()
1945 drmmode_adjust_frame(pScrn, &ms->drmmode, x, y); in AdjustFrame()
1949 FreeScreen(ScrnInfoPtr pScrn) in FreeScreen() argument
1951 FreeRec(pScrn); in FreeScreen()
1955 LeaveVT(ScrnInfoPtr pScrn) in LeaveVT() argument
1957 modesettingPtr ms = modesettingPTR(pScrn); in LeaveVT()
1959 xf86_hide_cursors(pScrn); in LeaveVT()
1961 pScrn->vtSema = FALSE; in LeaveVT()
1977 EnterVT(ScrnInfoPtr pScrn) in EnterVT() argument
1979 modesettingPtr ms = modesettingPTR(pScrn); in EnterVT()
1981 pScrn->vtSema = TRUE; in EnterVT()
1983 SetMaster(pScrn); in EnterVT()
1991 if (!drmmode_set_desired_modes(pScrn, &ms->drmmode, TRUE, TRUE)) { in EnterVT()
1992 xf86DisableUnusedFunctions(pScrn); in EnterVT()
2001 RRSetChanged(xf86ScrnToScreen(pScrn)); in EnterVT()
2002 RRTellChanged(xf86ScrnToScreen(pScrn)); in EnterVT()
2009 SwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode) in SwitchMode() argument
2011 return xf86SetSingleMode(pScrn, mode, RR_Rotate_0); in SwitchMode()
2017 ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); in CloseScreen() local
2018 modesettingPtr ms = modesettingPTR(pScrn); in CloseScreen()
2019 modesettingEntPtr ms_ent = ms_ent_priv(pScrn); in CloseScreen()
2021 xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); in CloseScreen()
2060 drmmode_uevent_fini(pScrn, &ms->drmmode); in CloseScreen()
2062 drmmode_free_bos(pScrn, &ms->drmmode); in CloseScreen()
2077 if (pScrn->vtSema) { in CloseScreen()
2078 LeaveVT(pScrn); in CloseScreen()
2091 ms_deinit_exa(pScrn); in CloseScreen()
2099 pScrn->vtSema = FALSE; in CloseScreen()