From: Joonyoung Shim Date: Mon, 13 Apr 2015 08:32:15 +0000 (+0900) Subject: modetest: make use of drmModeRmFB X-Git-Tag: libdrm-2.4.61~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bcaaa75cf482c7d218340c850ffc01f04b78b3dd;p=platform%2Fupstream%2Flibdrm.git modetest: make use of drmModeRmFB We should remove the framebuffer before destroying the buffer. Signed-off-by: Joonyoung Shim [Emil Velikov: Tweak the commit message. fb_id = 0 is unused] Reviewed-by: Emil Velikov --- diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index 966c2b6..66d13c5 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -1061,6 +1061,7 @@ static void set_mode(struct device *dev, struct pipe_arg *pipes, unsigned int co dev->mode.width = 0; dev->mode.height = 0; + dev->mode.fb_id = 0; for (i = 0; i < count; i++) { struct pipe_arg *pipe = &pipes[i]; @@ -1121,6 +1122,8 @@ static void set_mode(struct device *dev, struct pipe_arg *pipes, unsigned int co static void clear_mode(struct device *dev) { + if (dev->mode.fb_id) + drmModeRmFB(dev->fd, dev->mode.fb_id); if (dev->mode.bo) bo_destroy(dev->mode.bo); } @@ -1261,6 +1264,7 @@ static void test_page_flip(struct device *dev, struct pipe_arg *pipes, unsigned drmHandleEvent(dev->fd, &evctx); } + drmModeRmFB(dev->fd, other_fb_id); bo_destroy(other_bo); }