[PATCH 08/12] Get rid of glamor stubs in intel_glamor.h
Keith Packard
keithp at keithp.com
Thu Jul 24 16:18:24 PDT 2014
This eliminates the stubs in intel_glamor.h and replaces them with
ifdefs instead.
Signed-off-by: Keith Packard <keithp at keithp.com>
---
src/uxa/intel_dri.c | 20 ++++++++++++++++++--
src/uxa/intel_driver.c | 6 ++++++
src/uxa/intel_glamor.h | 21 ---------------------
src/uxa/intel_present.c | 2 ++
src/uxa/intel_video.c | 4 ++++
5 files changed, 30 insertions(+), 23 deletions(-)
diff --git a/src/uxa/intel_dri.c b/src/uxa/intel_dri.c
index 79978ab..78734cb 100644
--- a/src/uxa/intel_dri.c
+++ b/src/uxa/intel_dri.c
@@ -66,7 +66,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "dri2.h"
+#if USE_GLAMOR
#include "intel_glamor.h"
+#endif
#include "uxa.h"
typedef struct {
@@ -107,6 +109,7 @@ static PixmapPtr get_front_buffer(DrawablePtr drawable)
return pixmap;
}
+#if USE_GLAMOR
static PixmapPtr fixup_glamor(DrawablePtr drawable, PixmapPtr pixmap)
{
ScreenPtr screen = drawable->pScreen;
@@ -158,6 +161,7 @@ static PixmapPtr fixup_glamor(DrawablePtr drawable, PixmapPtr pixmap)
intel_get_screen_private(xf86ScreenToScrn(screen))->needs_flush = TRUE;
return old;
}
+#endif
#if DRI2INFOREC_VERSION < 2
static DRI2BufferPtr
@@ -170,7 +174,9 @@ I830DRI2CreateBuffers(DrawablePtr drawable, unsigned int *attachments,
DRI2BufferPtr buffers;
I830DRI2BufferPrivatePtr privates;
PixmapPtr pixmap, pDepthPixmap;
+#if USE_GLAMOR
Bool is_glamor_pixmap = FALSE;
+#endif
int i;
buffers = calloc(count, sizeof *buffers);
@@ -187,11 +193,12 @@ I830DRI2CreateBuffers(DrawablePtr drawable, unsigned int *attachments,
pixmap = NULL;
if (attachments[i] == DRI2BufferFrontLeft) {
pixmap = get_front_buffer(drawable);
-
+#if USE_GLAMOR
if (pixmap == NULL) {
drawable = &(get_drawable_pixmap(drawable)->drawable);
is_glamor_pixmap = TRUE;
}
+#endif
} else if (attachments[i] == DRI2BufferStencil && pDepthPixmap) {
pixmap = pDepthPixmap;
pixmap->refcnt++;
@@ -230,8 +237,10 @@ I830DRI2CreateBuffers(DrawablePtr drawable, unsigned int *attachments,
goto unwind;
}
+#if USE_GLAMOR
if (is_glamor_pixmap)
pixmap = fixup_glamor(drawable, pixmap);
+#endif
}
if (attachments[i] == DRI2BufferDepth)
@@ -292,7 +301,9 @@ I830DRI2CreateBuffer(DrawablePtr drawable, unsigned int attachment,
DRI2Buffer2Ptr buffer;
I830DRI2BufferPrivatePtr privates;
PixmapPtr pixmap;
+#if USE_GLAMOR
Bool is_glamor_pixmap = FALSE;
+#endif
buffer = calloc(1, sizeof *buffer);
if (buffer == NULL)
@@ -306,11 +317,12 @@ I830DRI2CreateBuffer(DrawablePtr drawable, unsigned int attachment,
pixmap = NULL;
if (attachment == DRI2BufferFrontLeft) {
pixmap = get_front_buffer(drawable);
-
+#if USE_GLAMOR
if (pixmap == NULL) {
drawable = &(get_drawable_pixmap(drawable)->drawable);
is_glamor_pixmap = TRUE;
}
+#endif
}
if (pixmap == NULL) {
@@ -383,8 +395,10 @@ I830DRI2CreateBuffer(DrawablePtr drawable, unsigned int attachment,
free(buffer);
return NULL;
}
+#if USE_GLAMOR
if (is_glamor_pixmap)
pixmap = fixup_glamor(drawable, pixmap);
+#endif
}
buffer->attachment = attachment;
@@ -762,7 +776,9 @@ intel_exchange_pixmap_buffers(struct intel_screen_private *intel, PixmapPtr fron
new_front->busy = 1;
new_back->busy = -1;
+#if USE_GLAMOR
intel_glamor_exchange_buffers(intel, front, back);
+#endif
DamageRegionProcessPending(&front->drawable);
diff --git a/src/uxa/intel_driver.c b/src/uxa/intel_driver.c
index a764b97..6d38cfe 100644
--- a/src/uxa/intel_driver.c
+++ b/src/uxa/intel_driver.c
@@ -72,7 +72,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "i915_drm.h"
+#if USE_GLAMOR
#include "intel_glamor.h"
+#endif
#include "intel_options.h"
static void i830AdjustFrame(ADJUST_FRAME_ARGS_DECL);
@@ -610,12 +612,14 @@ static Bool I830PreInit(ScrnInfoPtr scrn, int flags)
return FALSE;
}
+#if USE_GLAMOR
if (!intel_glamor_pre_init(scrn)) {
PreInitCleanup(scrn);
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"Failed to pre init glamor display.\n");
return FALSE;
}
+#endif
/* Load the dri modules if requested. */
#if HAVE_DRI2
@@ -1125,7 +1129,9 @@ static Bool I830CloseScreen(CLOSE_SCREEN_ARGS_DECL)
DeleteCallback(&FlushCallback, intel_flush_callback, scrn);
+#if USE_GLAMOR
intel_glamor_close_screen(screen);
+#endif
TimerFree(intel->cache_expire);
intel->cache_expire = NULL;
diff --git a/src/uxa/intel_glamor.h b/src/uxa/intel_glamor.h
index 2e305fc..97c2257 100644
--- a/src/uxa/intel_glamor.h
+++ b/src/uxa/intel_glamor.h
@@ -32,8 +32,6 @@
#include <xf86xv.h>
-#ifdef USE_GLAMOR
-
Bool intel_glamor_pre_init(ScrnInfoPtr scrn);
Bool intel_glamor_init(ScreenPtr screen);
Bool intel_glamor_create_screen_resources(ScreenPtr screen);
@@ -48,24 +46,5 @@ PixmapPtr intel_glamor_create_pixmap(ScreenPtr screen, int w, int h,
int depth, unsigned int usage);
void intel_glamor_exchange_buffers(struct intel_screen_private *intel, PixmapPtr src, PixmapPtr dst);
XF86VideoAdaptorPtr intel_glamor_xv_init(ScreenPtr screen, int num_ports);
-#else
-
-static inline Bool intel_glamor_pre_init(ScrnInfoPtr scrn) { return TRUE; }
-static inline Bool intel_glamor_init(ScreenPtr screen) { return TRUE; }
-static inline Bool intel_glamor_create_screen_resources(ScreenPtr screen) { return TRUE; }
-static inline Bool intel_glamor_close_screen(ScreenPtr screen) { return TRUE; }
-static inline void intel_glamor_free_screen(int scrnIndex, int flags) { }
-
-static inline void intel_glamor_flush(intel_screen_private * intel) { }
-
-static inline Bool intel_glamor_create_textured_pixmap(PixmapPtr pixmap) { return TRUE; }
-static inline void intel_glamor_destroy_pixmap(PixmapPtr pixmap) { }
-
-static inline PixmapPtr intel_glamor_create_pixmap(ScreenPtr screen, int w, int h,
- int depth, unsigned int usage) { return NULL; }
-
-static inline void intel_glamor_exchange_buffers(struct intel_screen_private *intel, PixmapPtr src, PixmapPtr dst) {}
-static inline XF86VideoAdaptorPtr intel_glamor_xv_init(ScreenPtr screen, int num_ports) { return NULL; }
-#endif
#endif /* INTEL_GLAMOR_H */
diff --git a/src/uxa/intel_present.c b/src/uxa/intel_present.c
index 5f98da8..c53d71d 100644
--- a/src/uxa/intel_present.c
+++ b/src/uxa/intel_present.c
@@ -54,7 +54,9 @@
#include "present.h"
+#if USE_GLAMOR
#include "intel_glamor.h"
+#endif
#include "uxa.h"
struct intel_present_vblank_event {
diff --git a/src/uxa/intel_video.c b/src/uxa/intel_video.c
index 310b6c9..ae3d351 100644
--- a/src/uxa/intel_video.c
+++ b/src/uxa/intel_video.c
@@ -78,7 +78,9 @@
#define _INTEL_XVMC_SERVER_
#include "intel_xvmc.h"
#endif
+#if USE_GLAMOR
#include "intel_glamor.h"
+#endif
#include "intel_uxa.h"
#include "intel_video_overlay.h"
@@ -213,10 +215,12 @@ void intel_video_init(ScreenPtr screen)
}
}
+#if USE_GLAMOR
glamorAdaptor = intel_glamor_xv_init(screen, 16);
if (glamorAdaptor != NULL)
xf86DrvMsg(scrn->scrnIndex, X_INFO,
"Set up textured video using glamor\n");
+#endif
if (overlayAdaptor && intel->XvPreferOverlay)
--
2.0.1
More information about the xorg-devel
mailing list