modesetting: Drop code for GLAMOR && !GLAMOR_HAS_GBM.

The glamor_egl module that the GLAMOR paths are using is only built if
GLAMOR_HAS_GBM is true, and there's no plan for implementing the
module without GBM.  Simplify modesetting's code as a result.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Eric Anholt 2017-05-16 11:37:14 -07:00 committed by Adam Jackson
parent 5102ea38eb
commit 32957d9fae
6 changed files with 19 additions and 34 deletions

View File

@ -42,7 +42,7 @@
#include "driver.h" #include "driver.h"
#include "dri2.h" #include "dri2.h"
#ifdef GLAMOR #ifdef GLAMOR_HAS_GBM
enum ms_dri2_frame_event_type { enum ms_dri2_frame_event_type {
MS_DRI2_QUEUE_SWAP, MS_DRI2_QUEUE_SWAP,
@ -1113,4 +1113,4 @@ ms_dri2_close_screen(ScreenPtr screen)
DRI2CloseScreen(screen); DRI2CloseScreen(screen);
} }
#endif /* GLAMOR */ #endif /* GLAMOR_HAS_GBM */

View File

@ -593,7 +593,7 @@ redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty, int *timeout)
PixmapSyncDirtyHelper(dirty); PixmapSyncDirtyHelper(dirty);
if (!screen->isGPU) { if (!screen->isGPU) {
#ifdef GLAMOR #ifdef GLAMOR_HAS_GBM
/* /*
* When copying from the master framebuffer to the shared pixmap, * When copying from the master framebuffer to the shared pixmap,
* we must ensure the copy is complete before the slave starts a * we must ensure the copy is complete before the slave starts a
@ -738,7 +738,7 @@ try_enable_glamor(ScrnInfoPtr pScrn)
ms->drmmode.glamor = FALSE; ms->drmmode.glamor = FALSE;
#ifdef GLAMOR #ifdef GLAMOR_HAS_GBM
if (ms->drmmode.force_24_32) { if (ms->drmmode.force_24_32) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Cannot use glamor with 24bpp packed fb\n"); xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Cannot use glamor with 24bpp packed fb\n");
return; return;
@ -1410,7 +1410,7 @@ msSharePixmapBacking(PixmapPtr ppix, ScreenPtr screen, void **handle)
static Bool static Bool
msSetSharedPixmapBacking(PixmapPtr ppix, void *fd_handle) msSetSharedPixmapBacking(PixmapPtr ppix, void *fd_handle)
{ {
#ifdef GLAMOR #ifdef GLAMOR_HAS_GBM
ScreenPtr screen = ppix->drawable.pScreen; ScreenPtr screen = ppix->drawable.pScreen;
ScrnInfoPtr scrn = xf86ScreenToScrn(screen); ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
modesettingPtr ms = modesettingPTR(scrn); modesettingPtr ms = modesettingPTR(scrn);
@ -1599,7 +1599,7 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv)
fbPictureInit(pScreen, NULL, 0); fbPictureInit(pScreen, NULL, 0);
#ifdef GLAMOR #ifdef GLAMOR_HAS_GBM
if (ms->drmmode.glamor) { if (ms->drmmode.glamor) {
if (!glamor_init(pScreen, GLAMOR_USE_EGL_SCREEN)) { if (!glamor_init(pScreen, GLAMOR_USE_EGL_SCREEN)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@ -1666,7 +1666,7 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv)
xf86DPMSInit(pScreen, xf86DPMSSet, 0); xf86DPMSInit(pScreen, xf86DPMSSet, 0);
#ifdef GLAMOR #ifdef GLAMOR_HAS_GBM
if (ms->drmmode.glamor) { if (ms->drmmode.glamor) {
XF86VideoAdaptorPtr glamor_adaptor; XF86VideoAdaptorPtr glamor_adaptor;
@ -1688,7 +1688,7 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv)
return FALSE; return FALSE;
} }
#ifdef GLAMOR #ifdef GLAMOR_HAS_GBM
if (ms->drmmode.glamor) { if (ms->drmmode.glamor) {
if (!ms_dri2_screen_init(pScreen)) { if (!ms_dri2_screen_init(pScreen)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@ -1789,7 +1789,7 @@ CloseScreen(ScreenPtr pScreen)
/* Clear mask of assigned crtc's in this generation */ /* Clear mask of assigned crtc's in this generation */
ms_ent->assigned_crtcs = 0; ms_ent->assigned_crtcs = 0;
#ifdef GLAMOR #ifdef GLAMOR_HAS_GBM
if (ms->drmmode.glamor) { if (ms->drmmode.glamor) {
ms_dri2_close_screen(pScreen); ms_dri2_close_screen(pScreen);
} }

View File

@ -33,13 +33,11 @@
#include <xf86Crtc.h> #include <xf86Crtc.h>
#include <damage.h> #include <damage.h>
#ifdef GLAMOR #ifdef GLAMOR_HAS_GBM
#define GLAMOR_FOR_XORG 1 #define GLAMOR_FOR_XORG 1
#include "glamor.h" #include "glamor.h"
#ifdef GLAMOR_HAS_GBM
#include <gbm.h> #include <gbm.h>
#endif #endif
#endif
#include "drmmode_display.h" #include "drmmode_display.h"
#define DRV_ERROR(msg) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, msg); #define DRV_ERROR(msg) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, msg);
@ -146,7 +144,7 @@ void ms_vblank_close_screen(ScreenPtr screen);
Bool ms_present_screen_init(ScreenPtr screen); Bool ms_present_screen_init(ScreenPtr screen);
#ifdef GLAMOR #ifdef GLAMOR_HAS_GBM
typedef void (*ms_pageflip_handler_proc)(modesettingPtr ms, typedef void (*ms_pageflip_handler_proc)(modesettingPtr ms,
uint64_t frame, uint64_t frame,

View File

@ -496,7 +496,7 @@ drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode)
drmmode_crtc->dpms_mode = mode; drmmode_crtc->dpms_mode = mode;
} }
#ifdef GLAMOR #ifdef GLAMOR_HAS_GBM
static PixmapPtr static PixmapPtr
create_pixmap_for_fbcon(drmmode_ptr drmmode, ScrnInfoPtr pScrn, int fbcon_id) create_pixmap_for_fbcon(drmmode_ptr drmmode, ScrnInfoPtr pScrn, int fbcon_id)
{ {
@ -546,7 +546,7 @@ out_free_fb:
void void
drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode) drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
{ {
#ifdef GLAMOR #ifdef GLAMOR_HAS_GBM
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
ScreenPtr pScreen = xf86ScrnToScreen(pScrn); ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
PixmapPtr src, dst; PixmapPtr src, dst;
@ -1895,27 +1895,16 @@ drmmode_clones_init(ScrnInfoPtr scrn, drmmode_ptr drmmode, drmModeResPtr mode_re
static Bool static Bool
drmmode_set_pixmap_bo(drmmode_ptr drmmode, PixmapPtr pixmap, drmmode_bo *bo) drmmode_set_pixmap_bo(drmmode_ptr drmmode, PixmapPtr pixmap, drmmode_bo *bo)
{ {
#ifdef GLAMOR #ifdef GLAMOR_HAS_GBM
ScrnInfoPtr scrn = drmmode->scrn; ScrnInfoPtr scrn = drmmode->scrn;
if (!drmmode->glamor) if (!drmmode->glamor)
return TRUE; return TRUE;
#ifdef GLAMOR_HAS_GBM
if (!glamor_egl_create_textured_pixmap_from_gbm_bo(pixmap, bo->gbm)) { if (!glamor_egl_create_textured_pixmap_from_gbm_bo(pixmap, bo->gbm)) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed"); xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed");
return FALSE; return FALSE;
} }
#else
if (!glamor_egl_create_textured_pixmap(pixmap,
drmmode_bo_get_handle(&drmmode->front_bo),
scrn->displayWidth *
scrn->bitsPerPixel / 8)) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"glamor_egl_create_textured_pixmap() failed\n");
return FALSE;
}
#endif
#endif #endif
return TRUE; return TRUE;
@ -1930,7 +1919,7 @@ drmmode_glamor_handle_new_screen_pixmap(drmmode_ptr drmmode)
if (!drmmode_set_pixmap_bo(drmmode, screen_pixmap, &drmmode->front_bo)) if (!drmmode_set_pixmap_bo(drmmode, screen_pixmap, &drmmode->front_bo))
return FALSE; return FALSE;
#ifdef GLAMOR #ifdef GLAMOR_HAS_GBM
if (drmmode->glamor) if (drmmode->glamor)
glamor_set_screen_pixmap(screen_pixmap, NULL); glamor_set_screen_pixmap(screen_pixmap, NULL);
#endif #endif

View File

@ -63,7 +63,7 @@ ms_flush_drm_events(ScreenPtr screen)
return 1; return 1;
} }
#ifdef GLAMOR #ifdef GLAMOR_HAS_GBM
/* /*
* Event data for an in progress flip. * Event data for an in progress flip.

View File

@ -180,7 +180,7 @@ ms_present_abort_vblank(RRCrtcPtr crtc, uint64_t event_id, uint64_t msc)
static void static void
ms_present_flush(WindowPtr window) ms_present_flush(WindowPtr window)
{ {
#ifdef GLAMOR #ifdef GLAMOR_HAS_GBM
ScreenPtr screen = window->drawable.pScreen; ScreenPtr screen = window->drawable.pScreen;
ScrnInfoPtr scrn = xf86ScreenToScrn(screen); ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
modesettingPtr ms = modesettingPTR(scrn); modesettingPtr ms = modesettingPTR(scrn);
@ -190,7 +190,7 @@ ms_present_flush(WindowPtr window)
#endif #endif
} }
#ifdef GLAMOR #ifdef GLAMOR_HAS_GBM
/** /**
* Callback for the DRM event queue when a flip has completed on all pipes * Callback for the DRM event queue when a flip has completed on all pipes
@ -255,10 +255,8 @@ ms_present_check_flip(RRCrtcPtr crtc,
drmmode_crtc_private_ptr drmmode_crtc = config->crtc[i]->driver_private; drmmode_crtc_private_ptr drmmode_crtc = config->crtc[i]->driver_private;
/* Don't do pageflipping if CRTCs are rotated. */ /* Don't do pageflipping if CRTCs are rotated. */
#ifdef GLAMOR_HAS_GBM
if (drmmode_crtc->rotate_bo.gbm) if (drmmode_crtc->rotate_bo.gbm)
return FALSE; return FALSE;
#endif
if (ms_crtc_on(config->crtc[i])) if (ms_crtc_on(config->crtc[i]))
num_crtcs_on++; num_crtcs_on++;
@ -387,7 +385,7 @@ static present_screen_info_rec ms_present_screen_info = {
.flush = ms_present_flush, .flush = ms_present_flush,
.capabilities = PresentCapabilityNone, .capabilities = PresentCapabilityNone,
#ifdef GLAMOR #ifdef GLAMOR_HAS_GBM
.check_flip = ms_present_check_flip, .check_flip = ms_present_check_flip,
.flip = ms_present_flip, .flip = ms_present_flip,
.unflip = ms_present_unflip, .unflip = ms_present_unflip,