From patchwork Thu Jul 29 22:34:19 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kristian Hogsberg X-Patchwork-Id: 115338 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6TMZSZ2005914 for ; Thu, 29 Jul 2010 22:36:03 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 099329ED00 for ; Thu, 29 Jul 2010 15:35:28 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id 2E7829EC9B for ; Thu, 29 Jul 2010 15:35:19 -0700 (PDT) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 29 Jul 2010 15:35:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.55,283,1278313200"; d="scan'208";a="306075420" Received: from unknown (HELO intel.com) ([10.255.13.60]) by azsmga001.ch.intel.com with ESMTP; 29 Jul 2010 15:35:15 -0700 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= To: intel-gfx@lists.freedesktop.org, chris@chris-wilson.co.uk Date: Thu, 29 Jul 2010 18:34:19 -0400 Message-Id: <1280442859-24569-1-git-send-email-krh@bitplanet.net> X-Mailer: git-send-email 1.7.2 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH] Submit batch buffers from flush callback chain X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 29 Jul 2010 22:36:03 +0000 (UTC) X-MIME-Autoconverted: from base64 to 8bit by demeter.kernel.org id o6TMZSZ2005914 diff --git a/src/intel_driver.c b/src/intel_driver.c index 7761ccf..d09c432 100644 --- a/src/intel_driver.c +++ b/src/intel_driver.c @@ -678,16 +678,8 @@ I830BlockHandler(int i, pointer blockData, pointer pTimeout, pointer pReadmask) intel->BlockHandler = screen->BlockHandler; screen->BlockHandler = I830BlockHandler; - if (scrn->vtSema) { - /* Emit a flush of the rendering cache, or on the 965 and beyond - * rendering results may not hit the framebuffer until significantly - * later. - */ - intel_batch_submit(scrn, - intel->need_mi_flush || - !list_is_empty(&intel->flush_pixmaps)); + if (scrn->vtSema == TRUE) drmCommandNone(intel->drmSubFD, DRM_I915_GEM_THROTTLE); - } intel_uxa_block_handler(intel); intel_video_block_handler(intel); @@ -787,6 +779,24 @@ int intel_crtc_to_pipe(xf86CrtcPtr crtc) return drmmode_get_pipe_from_crtc_id(intel->bufmgr, crtc); } +static void +intel_flush_callback(CallbackListPtr *list, + pointer user_data, pointer call_data) +{ + ScrnInfoPtr scrn = user_data; + intel_screen_private *intel = intel_get_screen_private(scrn); + + if (scrn->vtSema) { + /* Emit a flush of the rendering cache, or on the 965 + * and beyond rendering results may not hit the + * framebuffer until significantly later. + */ + intel_batch_submit(scrn, + intel->need_mi_flush || + !list_is_empty(&intel->flush_pixmaps)); + } +} + static Bool I830ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv) { @@ -955,6 +965,9 @@ I830ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv) intel->BlockHandler = screen->BlockHandler; screen->BlockHandler = I830BlockHandler; + if (!AddCallback(&FlushCallback, intel_flush_callback, scrn)) + return FALSE; + screen->SaveScreen = xf86SaveScreen; intel->CloseScreen = screen->CloseScreen; screen->CloseScreen = I830CloseScreen; @@ -1114,6 +1127,8 @@ static Bool I830CloseScreen(int scrnIndex, ScreenPtr screen) intel->front_buffer = NULL; } + DeleteCallback(&FlushCallback, intel_flush_callback, scrn); + intel_batch_teardown(scrn); if (IS_I965G(intel))