projects
/
profile
/
ivi
/
libdrm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
516c7a7
)
Small update to modedemo
author
Jakob Bornecrantz
<jakob@tungstengraphics.com>
Thu, 7 Feb 2008 18:22:38 +0000
(19:22 +0100)
committer
Jakob Bornecrantz
<jakob@tungstengraphics.com>
Thu, 7 Feb 2008 18:22:38 +0000
(19:22 +0100)
tests/modedemo/demo.c
patch
|
blob
|
history
diff --git
a/tests/modedemo/demo.c
b/tests/modedemo/demo.c
index
48a4f1f
..
0882fc9
100644
(file)
--- a/
tests/modedemo/demo.c
+++ b/
tests/modedemo/demo.c
@@
-201,12
+201,30
@@
int demoCreateScreens(struct demo_driver *driver)
void demoTakeDownScreen(struct demo_screen *screen)
{
void demoTakeDownScreen(struct demo_screen *screen)
{
- /* TODO Unrefence the BO */
- /* TODO Destroy FB */
- /* TODO take down the mode */
+ int fd = screen->driver->fd;
+ drmBO bo;
+
+ if (screen->crtc)
+ drmModeSetCrtc(fd, screen->crtc->crtc_id, 0, 0, 0, 0, 0, 0);
+
+ if (screen->fb)
+ drmModeRmFB(fd, screen->fb->buffer_id);
+
+ /* maybe we should keep a pointer to the bo on the screen */
+ if (screen->fb && !drmBOReference(fd, screen->fb->handle, &bo)) {
+ drmBOUnreference(fd, &bo);
+ drmBOUnreference(fd, &bo);
+ } else {
+ printf("bo error\n");
+ }
drmModeFreeOutput(screen->output);
drmModeFreeCrtc(screen->crtc);
drmModeFreeOutput(screen->output);
drmModeFreeCrtc(screen->crtc);
+ drmModeFreeFB(screen->fb);
+
+ screen->output = NULL;
+ screen->crtc = NULL;
+ screen->fb = NULL;
}
drmModeCrtcPtr demoFindFreeCrtc(struct demo_driver *driver, drmModeOutputPtr output)
}
drmModeCrtcPtr demoFindFreeCrtc(struct demo_driver *driver, drmModeOutputPtr output)