From patchwork Mon Jan 19 11:00:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 5657471 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1B0819F333 for ; Mon, 19 Jan 2015 11:17:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3D1CC2037B for ; Mon, 19 Jan 2015 11:17:32 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C8B9B20351 for ; Mon, 19 Jan 2015 11:17:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1E02E6E547; Mon, 19 Jan 2015 03:17:21 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from relay.fireflyinternet.com (hostedrelay.fireflyinternet.com [109.228.30.76]) by gabe.freedesktop.org (Postfix) with ESMTP id 01DDB6E53D; Mon, 19 Jan 2015 03:17:16 -0800 (PST) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from haswell.alporthouse.com (unverified [78.156.65.138]) by relay.fireflyinternet.com (FireflyRelay1) with ESMTP id 12848040-1305619 for multiple; Mon, 19 Jan 2015 11:00:53 +0000 From: Chris Wilson To: xorg-devel@lists.x.org, dri-devel@lists.freedesktop.org, mesa-dev@lists.freedesktop.org Subject: [xf86-video-ati] dri2: Enable BufferAge support Date: Mon, 19 Jan 2015 11:00:41 +0000 Message-Id: <1421665245-5994-6-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1421665245-5994-1-git-send-email-chris@chris-wilson.co.uk> References: <1421665245-5994-1-git-send-email-chris@chris-wilson.co.uk> MIME-Version: 1.0 X-Authenticated-User: chris.alporthouse@surfanytime.net Cc: Alex Deucher , Dave Airlie , Jerome Glisse , =?UTF-8?q?Michel=20D=C3=A4nzer?= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham 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 For BufferAge support, we just have to guarrantee that we were not using the DRI2Buffer->flags field for anything else (i.e. it is always 0) and then to make sure that we exchange the flags field after buffer exchanges. radeon does not support TripleBuffering so we do not have to worry about perserving the flags when injecting the third buffer. Signed-off-by: Chris Wilson Cc: Dave Airlie Cc: Jerome Glisse Cc: Alex Deucher Cc: Michel Dänzer Reviewed-by: Alex Deucher --- src/radeon_dri2.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c index 0fbe96c..091cd06 100644 --- a/src/radeon_dri2.c +++ b/src/radeon_dri2.c @@ -764,6 +764,11 @@ radeon_dri2_exchange_buffers(DrawablePtr draw, DRI2BufferPtr front, DRI2BufferPt front->name = back->name; back->name = tmp; + /* Swap flags so BufferAge works */ + tmp = front->flags; + front->flags = back->flags; + back->flags = tmp; + /* Swap pixmap bos */ front_bo = radeon_get_pixmap_bo(front_priv->pixmap); back_bo = radeon_get_pixmap_bo(back_priv->pixmap); @@ -1647,6 +1652,11 @@ radeon_dri2_screen_init(ScreenPtr pScreen) dri2_info.CopyRegion2 = radeon_dri2_copy_region2; #endif +#if DRI2INFOREC_VERSION >= 10 + dri2_info.version = 10; + dri2_info.bufferAge = 1; +#endif + info->dri2.enabled = DRI2ScreenInit(pScreen, &dri2_info); return info->dri2.enabled; }