From patchwork Mon Jul 30 04:06:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Airlie X-Patchwork-Id: 1253311 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id C47193FD2A for ; Mon, 30 Jul 2012 04:08:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A70A19F046 for ; Sun, 29 Jul 2012 21:08:37 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTP id 65FA39F0DD for ; Sun, 29 Jul 2012 21:07:01 -0700 (PDT) Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6U470Ik013251 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 30 Jul 2012 00:07:01 -0400 Received: from prime.bne.redhat.com (dhcp-41-76.bne.redhat.com [10.64.41.76]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q6U46vAD030038 for ; Mon, 30 Jul 2012 00:07:00 -0400 From: Dave Airlie To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/3] drm/udl: fix error handling in damage handler Date: Mon, 30 Jul 2012 14:06:56 +1000 Message-Id: <1343621216-14212-3-git-send-email-airlied@gmail.com> In-Reply-To: <1343621216-14212-1-git-send-email-airlied@gmail.com> References: <1343621216-14212-1-git-send-email-airlied@gmail.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Dave Airlie This checks the return from the hline renderer, and flags EAGAIN if we jump out here. Signed-off-by: Dave Airlie --- drivers/gpu/drm/udl/udl_fb.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/udl/udl_fb.c b/drivers/gpu/drm/udl/udl_fb.c index b8c00ed..dfd27e9 100644 --- a/drivers/gpu/drm/udl/udl_fb.c +++ b/drivers/gpu/drm/udl/udl_fb.c @@ -145,7 +145,7 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, int y, { struct drm_device *dev = fb->base.dev; struct udl_device *udl = dev->dev_private; - int i, ret; + int i, ret = 0; char *cmd; cycles_t start_cycles, end_cycles; int bytes_sent = 0; @@ -189,11 +189,14 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, int y, const int line_offset = fb->base.pitches[0] * i; const int byte_offset = line_offset + (x * bpp); - if (udl_render_hline(dev, bpp, &urb, + ret = udl_render_hline(dev, bpp, &urb, (char *) fb->obj->vmapping, &cmd, byte_offset, width * bpp, - &bytes_identical, &bytes_sent)) + &bytes_identical, &bytes_sent); + if (ret == 1) { + ret = -EAGAIN; goto error; + } } if (cmd > (char *) urb->transfer_buffer) { @@ -213,7 +216,7 @@ error: >> 10)), /* Kcycles */ &udl->cpu_kcycles_used); - return 0; + return ret; } static int udl_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)