uterm: dumb: clear buffer on allocation
authorDavid Herrmann <dh.herrmann@googlemail.com>
Mon, 22 Oct 2012 12:00:39 +0000 (14:00 +0200)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Mon, 22 Oct 2012 12:00:39 +0000 (14:00 +0200)
DRM buffers are not guaranteed to be cleared after allocation. This is to
boost performance for small buffers that are allocated and freed often.
However, for render-buffers we can clear them without loosing any
performance as they are allocated once and then only freed on shutdown.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/uterm_video_dumb.c

index 8df6202..c95d5aa 100644 (file)
@@ -110,6 +110,7 @@ static int init_rb(struct uterm_display *disp, struct dumb_rb *rb)
                ret = -EFAULT;
                goto err_fb;
        }
+       memset(rb->map, 0, rb->size);
 
        return 0;