[PATCH libdrm 5/5] modetest: destroy buffer of cursor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently, we are missing to destroy buffer of cursor when terminates
modetest.

Signed-off-by: Joonyoung Shim <jy0922.shim@xxxxxxxxxxx>
---
 tests/modetest/modetest.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index 56d49b0..758d86c 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -110,6 +110,7 @@ struct device {
 
 		unsigned int fb_id;
 		struct bo *bo;
+		struct bo *cursor_bo;
 	} mode;
 };
 
@@ -1167,6 +1168,8 @@ static void set_cursors(struct device *dev, struct pipe_arg *pipes, unsigned int
 	if (bo == NULL)
 		return;
 
+	dev->mode.cursor_bo = bo;
+
 	for (i = 0; i < count; i++) {
 		struct pipe_arg *pipe = &pipes[i];
 		ret = cursor_init(dev->fd, handles[0],
@@ -1186,6 +1189,9 @@ static void set_cursors(struct device *dev, struct pipe_arg *pipes, unsigned int
 static void clear_cursors(struct device *dev)
 {
 	cursor_stop();
+
+	if (dev->mode.cursor_bo)
+		bo_destroy(dev->mode.cursor_bo);
 }
 
 static void test_page_flip(struct device *dev, struct pipe_arg *pipes, unsigned int count)
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux