Re: [Intel-gfx] [PATCH 08/12] Get rid of glamor stubs in intel_glamor.h

2014-08-03 Thread Eric Anholt
Keith Packard kei...@keithp.com writes:

 This eliminates the stubs in intel_glamor.h and replaces them with
 ifdefs instead.

I don't feel strongly about this either way -- ifdefs are more
traditional userland style, while stubs are more kernel style.

Acked-by: Eric Anholt e...@anholt.net


pgpv5IVwrtIC1.pgp
Description: PGP signature
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 08/12] Get rid of glamor stubs in intel_glamor.h

2014-07-30 Thread Keith Packard
Eric Anholt e...@anholt.net writes:

 Keith Packard kei...@keithp.com writes:

 This eliminates the stubs in intel_glamor.h and replaces them with
 ifdefs instead.

 I don't feel strongly about this either way -- ifdefs are more
 traditional userland style, while stubs are more kernel style.

Right, just trying to keep things all the same and #ifdef USE_GLAMOR
seemed more common.

 Acked-by: Eric Anholt e...@anholt.net

-- 
keith.pack...@intel.com


pgp1ME88gbxeA.pgp
Description: PGP signature
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 08/12] Get rid of glamor stubs in intel_glamor.h

2014-07-24 Thread Keith Packard
This eliminates the stubs in intel_glamor.h and replaces them with
ifdefs instead.

Signed-off-by: Keith Packard kei...@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