From patchwork Thu Jul 24 23:18:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Packard X-Patchwork-Id: 4620511 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 722239F433 for ; Thu, 24 Jul 2014 23:19:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6884D201EC for ; Thu, 24 Jul 2014 23:19:07 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 19E58201DD for ; Thu, 24 Jul 2014 23:19:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 37E686E790; Thu, 24 Jul 2014 16:19:04 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from keithp.com (home.keithp.com [63.227.221.253]) by gabe.freedesktop.org (Postfix) with ESMTP id 2FCB46E785; Thu, 24 Jul 2014 16:19:02 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by keithp.com (Postfix) with ESMTP id DABE6760130; Thu, 24 Jul 2014 16:19:01 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from keithp.com ([127.0.0.1]) by localhost (keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 5LPgrPdW00CM; Thu, 24 Jul 2014 16:18:56 -0700 (PDT) Received: by keithp.com (Postfix, from userid 1033) id 3C540760142; Thu, 24 Jul 2014 16:18:34 -0700 (PDT) Received: from hiro.keithp.com (localhost [127.0.0.1]) by keithp.com (Postfix) with ESMTP id 9FE4F76013F; Thu, 24 Jul 2014 16:18:34 -0700 (PDT) Received: by hiro.keithp.com (Postfix, from userid 1001) id 82FE274A665; Thu, 24 Jul 2014 16:18:32 -0700 (PDT) From: Keith Packard To: xorg-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Date: Thu, 24 Jul 2014 16:18:24 -0700 Message-Id: <1406243908-1123-9-git-send-email-keithp@keithp.com> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1406243908-1123-1-git-send-email-keithp@keithp.com> References: <1406243908-1123-1-git-send-email-keithp@keithp.com> Subject: [Intel-gfx] [PATCH 08/12] Get rid of glamor stubs in intel_glamor.h X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This eliminates the stubs in intel_glamor.h and replaces them with ifdefs instead. Signed-off-by: Keith Packard Acked-by: Eric Anholt --- 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 -#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)