From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Christian_K=F6nig?= Subject: Re: [PATCH 5/5] drm/radeon: rework page flip handling v3 Date: Tue, 03 Jun 2014 15:45:42 +0200 Message-ID: <538DD186.7010300@vodafone.de> References: <1401202162-1925-1-git-send-email-deathsimple@vodafone.de> <1401202162-1925-5-git-send-email-deathsimple@vodafone.de> <53858890.6080503@daenzer.net> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" Content-Transfer-Encoding: quoted-printable Return-path: Received: from pegasos-out.vodafone.de (pegasos-out.vodafone.de [80.84.1.38]) by gabe.freedesktop.org (Postfix) with ESMTP id A9B926E3AF for ; Tue, 3 Jun 2014 06:45:55 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by pegasos-out.vodafone.de (Rohrpostix1 Daemon) with ESMTP id F07872608A2 for ; Tue, 3 Jun 2014 15:45:54 +0200 (CEST) Received: from pegasos-out.vodafone.de ([127.0.0.1]) by localhost (rohrpostix1.prod.vfnet.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xG+NVYl6gZhm for ; Tue, 3 Jun 2014 15:45:49 +0200 (CEST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Alex Deucher , =?ISO-8859-1?Q?Michel_D=E4nze?= =?ISO-8859-1?Q?r?= Cc: Maling list - DRI developers List-Id: dri-devel@lists.freedesktop.org Am 03.06.2014 15:31, schrieb Alex Deucher: > On Wed, May 28, 2014 at 2:56 AM, Michel D=E4nzer wro= te: >> On 27.05.2014 23:49, Christian K=F6nig wrote: >>> From: Christian K=F6nig >>> >>> Instead of trying to flip inside the vblank period when >>> the buffer is idle, offload blocking for idle to a kernel >>> thread and program the flip directly into the hardware. >>> >>> v2: add error handling, fix EBUSY handling >>> v3: add proper exclusive_lock handling >> [...] >> >>> + /* update crtc fb */ >>> + crtc->primary->fb =3D fb; >>> + >>> + /* We borrow the event spin lock for protecting flip_work */ >>> + spin_lock_irqsave(&crtc->dev->event_lock, flags); >>> + >>> + if (radeon_crtc->flip_work) { >>> + DRM_DEBUG_DRIVER("flip queue: crtc already busy\n"); >>> + spin_unlock_irqrestore(&crtc->dev->event_lock, flags); >>> + drm_gem_object_unreference_unlocked(&work->old_rbo->gem_b= ase); >>> + radeon_fence_unref(&work->fence); >>> + kfree(work); >>> + return -EBUSY; >>> + } >> If we return -EBUSY, we shouldn't change crtc->primary->fb, should we? I >> wonder if crtc->primary->fb shouldn't be changed in >> radeon_flip_work_func(), when we're sure we can actually flip. > How about this? Looks good to me. Reviewed-by: Christian K=F6nig > > Alex