Check-in [d7125f9b88]
Not logged in

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

Overview
Comment:add selected SDL2 upstream changes
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:d7125f9b88bcda28a427a9a62553289894dd1571
User & Date: chw 2019-03-13 09:18:56
Context
2019-03-14
04:55
more tear down tweaks for [64ef0979ba] and [f27d22789e] check-in: 222bf6cb1c user: chw tags: trunk
2019-03-13
09:27
merge with trunk check-in: 844ae85b75 user: chw tags: wtf-8-experiment
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
Changes

Changes to jni/SDL2/src/core/linux/SDL_evdev_kbd.c.

193
194
195
196
197
198
199
200
201
202
203
204
205
206
207

SDL_EVDEV_keyboard_state *
SDL_EVDEV_kbd_init(void)
{
    SDL_EVDEV_keyboard_state *kbd;
    int i;
    char flag_state;
    char shift_state[2] = {TIOCL_GETSHIFTSTATE, 0};

    kbd = (SDL_EVDEV_keyboard_state *)SDL_calloc(1, sizeof(*kbd));
    if (!kbd) {
        return NULL;
    }

    kbd->npadch = -1;







|







193
194
195
196
197
198
199
200
201
202
203
204
205
206
207

SDL_EVDEV_keyboard_state *
SDL_EVDEV_kbd_init(void)
{
    SDL_EVDEV_keyboard_state *kbd;
    int i;
    char flag_state;
    char shift_state[ sizeof (long) ] = {TIOCL_GETSHIFTSTATE, 0};

    kbd = (SDL_EVDEV_keyboard_state *)SDL_calloc(1, sizeof(*kbd));
    if (!kbd) {
        return NULL;
    }

    kbd->npadch = -1;

Changes to jni/SDL2/src/events/SDL_mouse.c.

582
583
584
585
586
587
588

589
590
591
592
593
594
595
    cursor = mouse->cursors;
    while (cursor) {
        next = cursor->next;
        SDL_FreeCursor(cursor);
        cursor = next;
    }
    mouse->cursors = NULL;


    if (mouse->def_cursor && mouse->FreeCursor) {
        mouse->FreeCursor(mouse->def_cursor);
        mouse->def_cursor = NULL;
    }

    if (mouse->clickstate) {







>







582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
    cursor = mouse->cursors;
    while (cursor) {
        next = cursor->next;
        SDL_FreeCursor(cursor);
        cursor = next;
    }
    mouse->cursors = NULL;
    mouse->cur_cursor = NULL;

    if (mouse->def_cursor && mouse->FreeCursor) {
        mouse->FreeCursor(mouse->def_cursor);
        mouse->def_cursor = NULL;
    }

    if (mouse->clickstate) {

Changes to jni/SDL2/src/video/kmsdrm/SDL_kmsdrmvideo.c.

402
403
404
405
406
407
408





409
410
411
412
413
414
415
...
466
467
468
469
470
471
472










473
474
475
476
477
478
479

#ifdef SDL_INPUT_LINUXEV
    SDL_EVDEV_Init();
#endif

    KMSDRM_InitMouse(_this);






cleanup:
    if (encoder != NULL)
        KMSDRM_drmModeFreeEncoder(encoder);
    if (connector != NULL)
        KMSDRM_drmModeFreeConnector(connector);
    if (resources != NULL)
        KMSDRM_drmModeFreeResources(resources);
................................................................................
        close(vdata->drm_fd);
        SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "Closed DRM FD %d", vdata->drm_fd);
        vdata->drm_fd = -1;
    }
#ifdef SDL_INPUT_LINUXEV
    SDL_EVDEV_Quit();
#endif










}

void
KMSDRM_GetDisplayModes(_THIS, SDL_VideoDisplay * display)
{
    /* Only one display mode available, the current one */
    SDL_AddDisplayMode(display, &display->current_mode);







>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>







402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
...
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494

#ifdef SDL_INPUT_LINUXEV
    SDL_EVDEV_Init();
#endif

    KMSDRM_InitMouse(_this);

    vdata->resources = resources;
    vdata->connector = connector;
    vdata->encoder = encoder;
    return ret;

cleanup:
    if (encoder != NULL)
        KMSDRM_drmModeFreeEncoder(encoder);
    if (connector != NULL)
        KMSDRM_drmModeFreeConnector(connector);
    if (resources != NULL)
        KMSDRM_drmModeFreeResources(resources);
................................................................................
        close(vdata->drm_fd);
        SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "Closed DRM FD %d", vdata->drm_fd);
        vdata->drm_fd = -1;
    }
#ifdef SDL_INPUT_LINUXEV
    SDL_EVDEV_Quit();
#endif

    if (vdata->encoder != NULL)
        KMSDRM_drmModeFreeEncoder(vdata->encoder);
    vdata->encoder = NULL;
    if (vdata->connector != NULL)
        KMSDRM_drmModeFreeConnector(vdata->connector);
    vdata->connector = NULL;
    if (vdata->resources != NULL)
        KMSDRM_drmModeFreeResources(vdata->resources);
    vdata->resources = NULL;
}

void
KMSDRM_GetDisplayModes(_THIS, SDL_VideoDisplay * display)
{
    /* Only one display mode available, the current one */
    SDL_AddDisplayMode(display, &display->current_mode);

Changes to jni/SDL2/src/video/kmsdrm/SDL_kmsdrmvideo.h.

42
43
44
45
46
47
48



49
50
51
52
53
54
55
    int drm_fd;                 /* DRM file desc */
    struct gbm_device *gbm;
    drmEventContext drm_evctx;  /* DRM event context */
    struct pollfd drm_pollfd;   /* pollfd containing DRM file desc */
    drmModeCrtc *saved_crtc;    /* Saved CRTC to restore on quit */
    uint32_t saved_conn_id;     /* Saved DRM connector ID */
    uint32_t crtc_id;           /* CRTC in use */



} SDL_VideoData;


typedef struct SDL_DisplayData
{
    uint32_t encoder_id;
    uint32_t crtc_id;







>
>
>







42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
    int drm_fd;                 /* DRM file desc */
    struct gbm_device *gbm;
    drmEventContext drm_evctx;  /* DRM event context */
    struct pollfd drm_pollfd;   /* pollfd containing DRM file desc */
    drmModeCrtc *saved_crtc;    /* Saved CRTC to restore on quit */
    uint32_t saved_conn_id;     /* Saved DRM connector ID */
    uint32_t crtc_id;           /* CRTC in use */
    drmModeRes *resources;
    drmModeConnector *connector;
    drmModeEncoder *encoder;
} SDL_VideoData;


typedef struct SDL_DisplayData
{
    uint32_t encoder_id;
    uint32_t crtc_id;