From: David Herrmann Date: Fri, 21 Sep 2012 11:20:21 +0000 (+0200) Subject: uterm: video: ignore NULL buffers in vector requests X-Git-Tag: kmscon-7~491 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ed969b99a8285165081fc86228e7cf09619e1c47;p=platform%2Fupstream%2Fkmscon.git uterm: video: ignore NULL buffers in vector requests When multiple requests are pushed into the video backends at once, we should ignore NULL buffers. Otherwise, users might have to re-order buffers just so we don't segfault. Instead, we now ignore them and the application can set requests to NULL to signal us that it is unused. This fixes some bugs with multi-monitor setups and kmscon. Signed-off-by: David Herrmann --- diff --git a/src/uterm_video_drm.c b/src/uterm_video_drm.c index 1259145..6ea5355 100644 --- a/src/uterm_video_drm.c +++ b/src/uterm_video_drm.c @@ -766,6 +766,9 @@ static int display_fake_blendv(struct uterm_display *disp, return -EINVAL; for (i = 0; i < num; ++i, ++req) { + if (!req->buf) + continue; + ret = display_blend(disp, req->buf, req->x, req->y, req->fr, req->fg, req->fb, req->br, req->bg, req->bb); diff --git a/src/uterm_video_dumb.c b/src/uterm_video_dumb.c index c3c4506..b054ff2 100644 --- a/src/uterm_video_dumb.c +++ b/src/uterm_video_dumb.c @@ -518,6 +518,9 @@ static int display_fake_blendv(struct uterm_display *disp, sh = disp->current_mode->dumb.info.vdisplay; for (j = 0; j < num; ++j, ++req) { + if (!req->buf) + continue; + if (req->buf->format != UTERM_FORMAT_GREY) return -EOPNOTSUPP; diff --git a/src/uterm_video_fbdev.c b/src/uterm_video_fbdev.c index ed17ae1..877ea28 100644 --- a/src/uterm_video_fbdev.c +++ b/src/uterm_video_fbdev.c @@ -651,6 +651,9 @@ static int display_fake_blendv(struct uterm_display *disp, return -EINVAL; for (j = 0; j < num; ++j, ++req) { + if (!req->buf) + continue; + if (req->buf->format != UTERM_FORMAT_GREY) return -EOPNOTSUPP;