Check-in [64ef0979ba]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:some tear down tweaks when using RPI/KMSDRM video drivers
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:64ef0979ba9928e835b6b6f47dc12d2b56ead8ef
User & Date: chw 2019-03-13 09:12:30
References
2019-03-14
04:55
more tear down tweaks for [64ef0979ba] and [f27d22789e] check-in: 222bf6cb1c user: chw tags: trunk
Context
2019-03-13
09:18
add selected SDL2 upstream changes check-in: d7125f9b88 user: chw tags: trunk
09:12
some tear down tweaks when using RPI/KMSDRM video drivers check-in: 64ef0979ba user: chw tags: trunk
09:10
add exit handler to tkvlc check-in: f27d22789e user: chw tags: trunk
Changes

Changes to jni/sdl2tk/sdl/SdlTkX.c.

49
50
51
52
53
54
55


56
57
58
59
60
61
62
....
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
....
5545
5546
5547
5548
5549
5550
5551



5552
5553
5554
5555
5556
5557
5558
....
5605
5606
5607
5608
5609
5610
5611



5612
5613
5614
5615
5616
5617
5618
....
6583
6584
6585
6586
6587
6588
6589


6590






6591


6592
6593
6594
6595
6596
6597
6598

#ifdef AGG_CUSTOM_ALLOCATOR
/* AGG custom allocator functions */
void *(*agg_custom_alloc)(unsigned int size) = NULL;
void (*agg_custom_free)(void *ptr) = NULL;
#endif



TCL_DECLARE_MUTEX(atom_mutex);
static int atom_initialized = 0;
static Tcl_HashTable atom_table;
static int prop_initialized = 0;
static Tcl_HashTable prop_table;

struct RootSizeRequest {
................................................................................
    SDL_PixelFormat *pfmt;
    int xdpi, ydpi;
    int initMask = SDL_INIT_VIDEO | SDL_INIT_JOYSTICK;
#ifndef ANDROID
    int tfmt = SDL_PIXELFORMAT_RGB888;
#endif
#ifdef linux
    int setQuit = 0, checkInput = 0;
    char *p;
#elif defined(__APPLE__) || defined(_WIN32)
    char *p;
#endif
    XGCValues values;

#ifdef AGG_CUSTOM_ALLOCATOR
................................................................................
	setQuit = 1;
	checkInput = 1;
	/*
	 * -sdlfullscreen with RPI driver doesn't work.
	 */
	SdlTkX.arg_fullscreen = 0;
    } else if (strcmp(p, "KMSDRM") == 0) {



	setQuit = 1;
	checkInput = 1;
	if (!SdlTkX.arg_nogl) {
	    /* Try to pre-load libGL.so for 3D canvas. */
	    dlopen("libGL.so.1", RTLD_NOW | RTLD_GLOBAL);
	}
    } else if (strcmp(p, "jsmpeg") == 0) {
................................................................................
	SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
	SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8);
    }
#endif

#ifdef linux
    if (setQuit) {



	atexit(DoSDLQuit);
    }
#endif

    /* Preset some defaults. */
    SdlTkX.dec_frame_width = 6;
    SdlTkX.dec_title_height = 20;
................................................................................
	    qevent = next;
	}
	SdlTkX.display->head = SdlTkX.display->tail = NULL;
	SdlTkX.display->qlen = 0;
	Tcl_MutexUnlock((Tcl_Mutex *) &SdlTkX.display->qlock);
    }
    SDL_RemoveTimer(timerId);


    /* Tear down font manager/engine. */






    SdlTkGfxDeinitFC();


eventThreadEnd:
#ifdef __APPLE__
    exit(3);
#else
    Tcl_ExitThread(0);
    TCL_THREAD_CREATE_RETURN;
#endif







>
>







 







|







 







>
>
>







 







>
>
>







 







>
>
|
>
>
>
>
>
>
|
>
>







49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
....
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
....
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
....
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
....
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616

#ifdef AGG_CUSTOM_ALLOCATOR
/* AGG custom allocator functions */
void *(*agg_custom_alloc)(unsigned int size) = NULL;
void (*agg_custom_free)(void *ptr) = NULL;
#endif

static int setQuit = 0;		/* True when atexit() handler set. */

TCL_DECLARE_MUTEX(atom_mutex);
static int atom_initialized = 0;
static Tcl_HashTable atom_table;
static int prop_initialized = 0;
static Tcl_HashTable prop_table;

struct RootSizeRequest {
................................................................................
    SDL_PixelFormat *pfmt;
    int xdpi, ydpi;
    int initMask = SDL_INIT_VIDEO | SDL_INIT_JOYSTICK;
#ifndef ANDROID
    int tfmt = SDL_PIXELFORMAT_RGB888;
#endif
#ifdef linux
    int checkInput = 0;
    char *p;
#elif defined(__APPLE__) || defined(_WIN32)
    char *p;
#endif
    XGCValues values;

#ifdef AGG_CUSTOM_ALLOCATOR
................................................................................
	setQuit = 1;
	checkInput = 1;
	/*
	 * -sdlfullscreen with RPI driver doesn't work.
	 */
	SdlTkX.arg_fullscreen = 0;
    } else if (strcmp(p, "KMSDRM") == 0) {
	/*
	 * See above, keyboard state.
	 */
	setQuit = 1;
	checkInput = 1;
	if (!SdlTkX.arg_nogl) {
	    /* Try to pre-load libGL.so for 3D canvas. */
	    dlopen("libGL.so.1", RTLD_NOW | RTLD_GLOBAL);
	}
    } else if (strcmp(p, "jsmpeg") == 0) {
................................................................................
	SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
	SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8);
    }
#endif

#ifdef linux
    if (setQuit) {
	/*
	 * See above, keyboard state.
	 */
	atexit(DoSDLQuit);
    }
#endif

    /* Preset some defaults. */
    SdlTkX.dec_frame_width = 6;
    SdlTkX.dec_title_height = 20;
................................................................................
	    qevent = next;
	}
	SdlTkX.display->head = SdlTkX.display->tail = NULL;
	SdlTkX.display->qlen = 0;
	Tcl_MutexUnlock((Tcl_Mutex *) &SdlTkX.display->qlock);
    }
    SDL_RemoveTimer(timerId);

    /*
     * Tear down font manager/engine. Do this only when no
     * atexit() handler is set. This is a workaround when
     * e.g. the tkvlc extension is used which otherwise seems
     * to cause heap corruption which hits the font cache
     * destructors.
     */
    if (!setQuit) {
	SdlTkGfxDeinitFC();
    }

eventThreadEnd:
#ifdef __APPLE__
    exit(3);
#else
    Tcl_ExitThread(0);
    TCL_THREAD_CREATE_RETURN;
#endif