[PATCH 3/3] drm/udl: fix error handling in damage handler
Dave Airlie
airlied at gmail.com
Sun Jul 29 21:06:56 PDT 2012
From: Dave Airlie <airlied at redhat.com>
This checks the return from the hline renderer, and flags EAGAIN
if we jump out here.
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
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)
--
1.7.10.2
More information about the dri-devel
mailing list