wsi: Correct getting tpl_display in vk_get_tpl_display() 34/130034/1 tizen_4.0 submit/submit/tizen/20170906.070327/20170906.070422 submit/tizen/20170920.051244
authorHoyub Lee <hoyub.lee@samsung.com>
Thu, 18 May 2017 11:36:09 +0000 (20:36 +0900)
committerHoyub Lee <hoyub.lee@samsung.com>
Fri, 19 May 2017 01:58:00 +0000 (10:58 +0900)
tpl_display_create() has been changed to [return existing tpl_display] from
[return NULL] if there is already existing one.

Therefore, this patch applies this behaviour change on vk_get_tpl_display().

Change-Id: I355b251d43e6e0e54b89aa533d43f33ada997017
Signed-off-by: Hoyub Lee <hoyub.lee@samsung.com>
src/wsi/wsi.h

index e629922..624623a 100644 (file)
@@ -194,12 +194,16 @@ vk_get_tpl_display(VkIcdSurfaceBase               *sfc)
                        return NULL;
        }
 
-       tpl_display_t *display = tpl_display_create(type, native_dpy);
-       if (display == NULL) {
-               display = tpl_display_get(native_dpy);
+       tpl_display_t *display = tpl_display_get(native_dpy);
+
+       if (display != NULL) {
                tpl_object_reference((tpl_object_t *)display);
+               return display;
+       }
+       else {
+               display = tpl_display_create(type, native_dpy);
+               return display;
        }
-       return display;
 };
 
 static inline tpl_handle_t