diff mbox

[3/3] drm/udl: fix error handling in damage handler

Message ID 1343621216-14212-3-git-send-email-airlied@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dave Airlie July 30, 2012, 4:06 a.m. UTC
From: Dave Airlie <airlied@redhat.com>

This checks the return from the hline renderer, and flags EAGAIN
if we jump out here.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/udl/udl_fb.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
diff mbox

Patch

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)