From patchwork Sun Oct 5 07:06:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 5033361 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7C4969F30B for ; Sun, 5 Oct 2014 07:07:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 80EF6201C8 for ; Sun, 5 Oct 2014 07:06:59 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2D943201C0 for ; Sun, 5 Oct 2014 07:06:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D2F9E6E0FB; Sun, 5 Oct 2014 00:06:54 -0700 (PDT) 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 4B3246E0FB for ; Sun, 5 Oct 2014 00:06:53 -0700 (PDT) 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 12164424-1305619 for multiple; Sun, 05 Oct 2014 08:17:20 +0100 From: Chris Wilson To: airlied@redhat.com Subject: [PATCH] Fallback to std DRI2CopyRegion when DRI2UpdatePrime fails Date: Sun, 5 Oct 2014 08:06:31 +0100 Message-Id: <1412492791-4121-1-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.1.1 X-Authenticated-User: chris.alporthouse@surfanytime.net Cc: xorg-devel@lists.freedesktop.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 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 I was looking at a bug report today of intel/ati prime and noticed a number of sna_share_pixmap_backing() failures (called from DRI2UpdatePrime). These were failing as the request was for the scanout buffer (which is tiled and so we refuse to share it, and since it is already on the scanout we refuse to change tiling). But looking at radeon_dri2_copy_region2(), if DRI2UpdatePrime() fails, the copy is aborted and the update lost. If the copy is made to the normal window drawable is that enough for it to be propagated back through damage tracking? --- src/radeon_dri2.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c index 9a9918b..0d113b9 100644 --- a/src/radeon_dri2.c +++ b/src/radeon_dri2.c @@ -409,26 +409,27 @@ radeon_dri2_copy_region2(ScreenPtr pScreen, dst_drawable = &dst_private->pixmap->drawable; if (src_private->attachment == DRI2BufferFrontLeft) { + src_drawable = NULL; #ifdef USE_DRI2_PRIME - if (drawable->pScreen != pScreen) { + if (drawable->pScreen != pScreen) src_drawable = DRI2UpdatePrime(drawable, src_buffer); - if (!src_drawable) - return; - } else #endif + if (src_drawable == NULL) src_drawable = drawable; } if (dst_private->attachment == DRI2BufferFrontLeft) { + dst_drawable = NULL; #ifdef USE_DRI2_PRIME if (drawable->pScreen != pScreen) { dst_drawable = DRI2UpdatePrime(drawable, dest_buffer); - if (!dst_drawable) - return; - dst_ppix = (PixmapPtr)dst_drawable; - if (dst_drawable != drawable) - translate = TRUE; - } else + if (dst_drawable) { + dst_ppix = (PixmapPtr)dst_drawable; + if (dst_drawable != drawable) + translate = TRUE; + } + } #endif + if (dst_drawable == NULL) dst_drawable = drawable; }