From patchwork Thu Oct 11 04:30:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Airlie X-Patchwork-Id: 1580981 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id D1B6CDFABE for ; Thu, 11 Oct 2012 04:30:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 94E519E81A for ; Wed, 10 Oct 2012 21:30:53 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTP id 051CB9E765 for ; Wed, 10 Oct 2012 21:30:32 -0700 (PDT) Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9B4UWaS031997 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 11 Oct 2012 00:30:32 -0400 Received: from prime.bne.redhat.com (dhcp-40-183.bne.redhat.com [10.64.40.183]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q9B4UUO1007134 for ; Thu, 11 Oct 2012 00:30:31 -0400 From: Dave Airlie To: intel-gfx@lists.freedesktop.org Date: Thu, 11 Oct 2012 14:30:29 +1000 Message-Id: <1349929829-25856-1-git-send-email-airlied@gmail.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Subject: [Intel-gfx] [PATCH] intel: fix fullscreen damage posting on pageflip X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 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 From: Dave Airlie While playing with MPX and sw cursor I noticed page flips won't end up misrendering some bits, so the sw cursor was replacing the bits on the wrong pixmap. Fix the damage handling to be correct and append damage before swapping the pointers and process damage after. This fixes misrendering with MPX cursors under a fullscreen compositor, that pageflips. Signed-off-by: Dave Airlie --- src/intel_dri.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/intel_dri.c b/src/intel_dri.c index 64cb567..867a465 100644 --- a/src/intel_dri.c +++ b/src/intel_dri.c @@ -725,6 +725,17 @@ static struct intel_pixmap * intel_exchange_pixmap_buffers(struct intel_screen_private *intel, PixmapPtr front, PixmapPtr back) { struct intel_pixmap *new_front, *new_back; + RegionRec region; + + /* Post damage on the front buffer so that listeners, such + * as DisplayLink know take a copy and shove it over the USB. + * also for sw cursors. + */ + region.extents.x1 = region.extents.y1 = 0; + region.extents.x2 = front->drawable.width; + region.extents.y2 = front->drawable.height; + region.data = NULL; + DamageRegionAppend(&front->drawable, ®ion); new_front = intel_get_pixmap_private(back); new_back = intel_get_pixmap_private(front); @@ -735,19 +746,7 @@ intel_exchange_pixmap_buffers(struct intel_screen_private *intel, PixmapPtr fron intel_glamor_exchange_buffers(intel, front, back); - /* Post damage on the new front buffer so that listeners, such - * as DisplayLink know take a copy and shove it over the USB. - */ - { - RegionRec region; - - region.extents.x1 = region.extents.y1 = 0; - region.extents.x2 = front->drawable.width; - region.extents.y2 = front->drawable.height; - region.data = NULL; - DamageRegionAppend(&front->drawable, ®ion); - DamageRegionProcessPending(&front->drawable); - } + DamageRegionProcessPending(&front->drawable); return new_front; }