diff options
author | SeokYeon Hwang <syeon.hwang@samsung.com> | 2014-11-05 21:04:03 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.vlan103.tizen.org> | 2014-11-05 21:04:03 -0800 |
commit | 2258f489d9ac6f74254204edd086646ab8734cc5 (patch) | |
tree | a4e26fbd8721f52d6eafbfc0bf99f09e3428b953 | |
parent | d4ac342c286291fce36710f379e92acfec194097 (diff) | |
parent | f4b91986a81b1db1de8294f4f2014bc1c993af7e (diff) | |
download | qemu-2258f489d9ac6f74254204edd086646ab8734cc5.tar.gz qemu-2258f489d9ac6f74254204edd086646ab8734cc5.tar.bz2 qemu-2258f489d9ac6f74254204edd086646ab8734cc5.zip |
Merge "display: unregister display change listener" into features/qt_dr
-rw-r--r-- | tizen/src/display/maru_display.c | 4 | ||||
-rw-r--r-- | tizen/src/display/maru_sdl.c | 19 | ||||
-rw-r--r-- | tizen/src/display/maru_shm.c | 14 | ||||
-rw-r--r-- | vl.c | 14 |
4 files changed, 33 insertions, 18 deletions
diff --git a/tizen/src/display/maru_display.c b/tizen/src/display/maru_display.c index 860dbcae64..8403cb5e6c 100644 --- a/tizen/src/display/maru_display.c +++ b/tizen/src/display/maru_display.c @@ -47,6 +47,8 @@ static void maru_display_fini(void) if (mdcl->fini) { mdcl->fini(); } + + g_free(mdcl); } static void maru_display_notify_exit(Notifier *notifier, void *data) { @@ -67,7 +69,6 @@ void maru_display_early_init(DisplayType display_type) } } -//TODO: interface void maru_display_init(DisplayState *ds, DisplayType display_type, int full_screen) { INFO("init qemu display\n"); @@ -96,7 +97,6 @@ void maru_display_init(DisplayState *ds, DisplayType display_type, int full_scre break; } - //register_displaychangelistener(mdcl->dcl); screenshot = g_malloc0(sizeof(MaruScreenShot)); screenshot->pixels = NULL; screenshot->request = false; diff --git a/tizen/src/display/maru_sdl.c b/tizen/src/display/maru_sdl.c index 66f916ca2f..4964bc15a5 100644 --- a/tizen/src/display/maru_sdl.c +++ b/tizen/src/display/maru_sdl.c @@ -45,6 +45,8 @@ MULTI_DEBUG_CHANNEL(tizen, maru_sdl); +static DisplayChangeListener *dcl; + static QEMUBH *sdl_init_bh; static QEMUBH *sdl_resize_bh; static QEMUBH *sdl_update_bh; @@ -483,6 +485,8 @@ static void maru_sdl_init_bh(void *opaque) SDL_GetWMInfo(&info); #endif + sdl_resize_bh = qemu_bh_new(maru_sdl_resize_bh, NULL); + sdl_update_bh = qemu_bh_new(maru_sdl_update_bh, NULL); qemu_bh_schedule(sdl_resize_bh); #ifdef SDL_THREAD @@ -537,13 +541,18 @@ static void maru_sdl_quit(void) qemu_cond_destroy(&sdl_cond); qemu_mutex_destroy(&sdl_mutex); #endif + + unregister_displaychangelistener(dcl); + g_free(dcl); } static void maru_sdl_resize(void) { INFO("maru sdl resize\n"); - qemu_bh_schedule(sdl_resize_bh); + if (sdl_resize_bh != NULL) { + qemu_bh_schedule(sdl_resize_bh); + } } static void maru_sdl_update(void) @@ -601,8 +610,9 @@ static void maru_sdl_init(uint64 swt_handle, qemu_bh_schedule(sdl_init_bh); } -void maru_sdl_pre_init(MaruDisplayChangeListener *mdcl) { - DisplayChangeListener *dcl = g_malloc0(sizeof(DisplayChangeListener)); +void maru_sdl_pre_init(MaruDisplayChangeListener *mdcl) +{ + dcl = g_malloc0(sizeof(DisplayChangeListener)); dcl->ops = &dcl_ops; mdcl->surface_init = maru_sdl_init; @@ -614,12 +624,11 @@ void maru_sdl_pre_init(MaruDisplayChangeListener *mdcl) { mdcl->set_interpolation = maru_sdl_set_interpolation; sdl_init_bh = qemu_bh_new(maru_sdl_init_bh, NULL); - sdl_resize_bh = qemu_bh_new(maru_sdl_resize_bh, NULL); - sdl_update_bh = qemu_bh_new(maru_sdl_update_bh, NULL); #ifdef SDL_THREAD qemu_mutex_init(&sdl_mutex); qemu_cond_init(&sdl_cond); #endif + register_displaychangelistener(dcl); } diff --git a/tizen/src/display/maru_shm.c b/tizen/src/display/maru_shm.c index 414491ae51..6d4213ffa0 100644 --- a/tizen/src/display/maru_shm.c +++ b/tizen/src/display/maru_shm.c @@ -41,6 +41,8 @@ MULTI_DEBUG_CHANNEL(tizen, maru_shm); +static DisplayChangeListener *dcl; + static DisplaySurface *dpy_surface; static void *shared_memory = (void *) 0; static int skin_shmid; @@ -228,6 +230,9 @@ static void maru_shm_quit(void) INFO("number of current attaches = %d\n", (int)shm_info.shm_nattch); } + + unregister_displaychangelistener(dcl); + g_free(dcl); } static void maru_shm_resize(void) @@ -288,15 +293,16 @@ static void maru_shm_init(uint64 swt_handle, INFO("Memory attached at 0x%X\n", (int)shared_memory); } - -void maru_shm_pre_init(MaruDisplayChangeListener *mdcl) { - DisplayChangeListener *dcl = g_malloc0(sizeof(DisplayChangeListener)); +void maru_shm_pre_init(MaruDisplayChangeListener *mdcl) +{ + dcl = g_malloc0(sizeof(DisplayChangeListener)); dcl->ops = &dcl_ops; - register_displaychangelistener(dcl); mdcl->surface_init = maru_shm_init; mdcl->fini = maru_shm_quit; mdcl->resize = maru_shm_resize; + + register_displaychangelistener(dcl); } @@ -2356,19 +2356,19 @@ static DisplayType select_display(const char *p) exit(1); #endif #ifdef CONFIG_MARU +# ifdef CONFIG_SDL } else if (strstart(p, "maru_sdl", &opts)) { -#ifdef CONFIG_SDL display = DT_MARU_SDL; -#endif +# endif +# ifdef CONFIG_USE_SHM } else if (strstart(p, "maru_shm", &opts)) { -#ifdef CONFIG_USE_SHM display = DT_MARU_SHM; -#endif +# endif +# ifdef CONFIG_QT } else if (strstart(p, "maru_qt", &opts)) { -#ifdef CONFIG_QT display = DT_MARU_QT; -#endif -#endif +# endif +#endif /* CONFIG_MARU */ } else if (strstart(p, "none", &opts)) { display = DT_NONE; } else { |