modesetting: Create helper for glamor_egl_create_textured_screen call.
This will need to change when we add GBM support; by pulling it into a helper function, we should only have to edit one place. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Tested-by: Jason Ekstrand <jason.ekstrand@intel.com> Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
b4324c6a23
commit
af4f94b08e
|
@ -886,18 +886,8 @@ CreateScreenResources(ScreenPtr pScreen)
|
||||||
if (!drmmode_set_desired_modes(pScrn, &ms->drmmode))
|
if (!drmmode_set_desired_modes(pScrn, &ms->drmmode))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
#ifdef GLAMOR
|
if (!drmmode_glamor_handle_new_screen_pixmap(&ms->drmmode))
|
||||||
if (ms->drmmode.glamor) {
|
return FALSE;
|
||||||
if (!glamor_egl_create_textured_screen(pScreen,
|
|
||||||
ms->drmmode.front_bo->handle,
|
|
||||||
pScrn->displayWidth *
|
|
||||||
pScrn->bitsPerPixel / 8)) {
|
|
||||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
|
||||||
"glamor_egl_create_textured_screen() failed\n");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
drmmode_uevent_init(pScrn, &ms->drmmode);
|
drmmode_uevent_init(pScrn, &ms->drmmode);
|
||||||
|
|
||||||
|
|
|
@ -1176,6 +1176,29 @@ drmmode_clones_init(ScrnInfoPtr scrn, drmmode_ptr drmmode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
drmmode_glamor_handle_new_screen_pixmap(drmmode_ptr drmmode)
|
||||||
|
{
|
||||||
|
#ifdef GLAMOR
|
||||||
|
ScrnInfoPtr scrn = drmmode->scrn;
|
||||||
|
ScreenPtr screen = xf86ScrnToScreen(drmmode->scrn);
|
||||||
|
|
||||||
|
if (!drmmode->glamor)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
if (!glamor_egl_create_textured_screen(screen,
|
||||||
|
drmmode->front_bo->handle,
|
||||||
|
scrn->displayWidth *
|
||||||
|
scrn->bitsPerPixel / 8)) {
|
||||||
|
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
|
||||||
|
"glamor_egl_create_textured_screen() failed\n");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
|
drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
|
||||||
{
|
{
|
||||||
|
@ -1243,18 +1266,8 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
|
||||||
|
|
||||||
screen->ModifyPixmapHeader(ppix, width, height, -1, -1, pitch, new_pixels);
|
screen->ModifyPixmapHeader(ppix, width, height, -1, -1, pitch, new_pixels);
|
||||||
|
|
||||||
#ifdef GLAMOR
|
if (!drmmode_glamor_handle_new_screen_pixmap(drmmode))
|
||||||
if (drmmode->glamor) {
|
goto fail;
|
||||||
if (!glamor_egl_create_textured_screen(screen,
|
|
||||||
drmmode->front_bo->handle,
|
|
||||||
scrn->displayWidth *
|
|
||||||
scrn->bitsPerPixel / 8)) {
|
|
||||||
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
|
|
||||||
"glamor_egl_create_textured_screen() failed\n");
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for (i = 0; i < xf86_config->num_crtc; i++) {
|
for (i = 0; i < xf86_config->num_crtc; i++) {
|
||||||
xf86CrtcPtr crtc = xf86_config->crtc[i];
|
xf86CrtcPtr crtc = xf86_config->crtc[i];
|
||||||
|
|
|
@ -129,6 +129,7 @@ extern DevPrivateKeyRec msPixmapPrivateKeyRec;
|
||||||
|
|
||||||
#define msGetPixmapPriv(drmmode, p) ((msPixmapPrivPtr)dixGetPrivateAddr(&(p)->devPrivates, &(drmmode)->pixmapPrivateKeyRec))
|
#define msGetPixmapPriv(drmmode, p) ((msPixmapPrivPtr)dixGetPrivateAddr(&(p)->devPrivates, &(drmmode)->pixmapPrivateKeyRec))
|
||||||
|
|
||||||
|
Bool drmmode_glamor_handle_new_screen_pixmap(drmmode_ptr drmmode);
|
||||||
void *drmmode_map_slave_bo(drmmode_ptr drmmode, msPixmapPrivPtr ppriv);
|
void *drmmode_map_slave_bo(drmmode_ptr drmmode, msPixmapPrivPtr ppriv);
|
||||||
Bool drmmode_SetSlaveBO(PixmapPtr ppix,
|
Bool drmmode_SetSlaveBO(PixmapPtr ppix,
|
||||||
drmmode_ptr drmmode,
|
drmmode_ptr drmmode,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user