Changeset 6fbd1f9 in mainline


Ignore:
Timestamp:
2024-10-14T16:30:24Z (2 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
514108e
Parents:
b3b79981
Message:

Combine successive move/abs. move events in display server

Helps avoid the cursor lagging if re-drawing cannot keep up
with the rate of move events.

Location:
uspace/srv/hid/display
Files:
4 added
6 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/display/display.c

    rb3b79981 r6fbd1f9  
    105105        list_initialize(&disp->ddevs);
    106106        list_initialize(&disp->idevcfgs);
     107        list_initialize(&disp->ievents);
     108        fibril_condvar_initialize(&disp->ievent_cv);
    107109        list_initialize(&disp->seats);
    108110        list_initialize(&disp->windows);
     
    129131        assert(list_empty(&disp->ddevs));
    130132        assert(list_empty(&disp->idevcfgs));
     133        assert(list_empty(&disp->ievents));
    131134        assert(list_empty(&disp->seats));
    132135        assert(list_empty(&disp->windows));
  • uspace/srv/hid/display/input.c

    rb3b79981 r6fbd1f9  
    11/*
    2  * Copyright (c) 2022 Jiri Svoboda
     2 * Copyright (c) 2024 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    4040#include <str_error.h>
    4141#include "display.h"
     42#include "ievent.h"
    4243#include "input.h"
    4344#include "main.h"
     
    8788
    8889        ds_display_lock(disp);
    89         rc = ds_display_post_kbd_event(disp, &event);
     90        rc = ds_ievent_post_kbd(disp, &event);
    9091        ds_display_unlock(disp);
    9192        return rc;
     
    104105
    105106        ds_display_lock(disp);
    106         rc = ds_display_post_ptd_event(disp, &event);
     107        rc = ds_ievent_post_ptd(disp, &event);
    107108        ds_display_unlock(disp);
    108109        return rc;
     
    126127
    127128        ds_display_lock(disp);
    128         rc = ds_display_post_ptd_event(disp, &event);
     129        rc = ds_ievent_post_ptd(disp, &event);
    129130        ds_display_unlock(disp);
    130131        return rc;
     
    145146
    146147        ds_display_lock(disp);
    147         rc = ds_display_post_ptd_event(disp, &event);
     148        rc = ds_ievent_post_ptd(disp, &event);
    148149        ds_display_unlock(disp);
    149150        return rc;
     
    163164
    164165        ds_display_lock(disp);
    165         rc = ds_display_post_ptd_event(disp, &event);
     166        rc = ds_ievent_post_ptd(disp, &event);
    166167        ds_display_unlock(disp);
    167168        return rc;
  • uspace/srv/hid/display/main.c

    rb3b79981 r6fbd1f9  
    5454#include "display.h"
    5555#include "dsops.h"
     56#include "ievent.h"
    5657#include "input.h"
    5758#include "main.h"
     
    156157        output->def_display = disp;
    157158        rc = ds_output_start_discovery(output);
     159        if (rc != EOK)
     160                goto error;
     161
     162        rc = ds_ievent_init(disp);
    158163        if (rc != EOK)
    159164                goto error;
     
    211216                ds_input_close(disp);
    212217#endif
     218        ds_ievent_fini(disp);
    213219        if (output != NULL)
    214220                ds_output_destroy(output);
  • uspace/srv/hid/display/meson.build

    rb3b79981 r6fbd1f9  
    4141        'dsops.c',
    4242        'idevcfg.c',
     43        'ievent.c',
    4344        'input.c',
    4445        'main.c',
     
    5960        'display.c',
    6061        'idevcfg.c',
     62        'ievent.c',
    6163        'seat.c',
    6264        'window.c',
     
    6769        'test/cursor.c',
    6870        'test/display.c',
     71        'test/ievent.c',
    6972        'test/main.c',
    7073        'test/seat.c',
  • uspace/srv/hid/display/test/main.c

    rb3b79981 r6fbd1f9  
    11/*
    2  * Copyright (c) 2023 Jiri Svoboda
     2 * Copyright (c) 2024 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    3636PCUT_IMPORT(cursor);
    3737PCUT_IMPORT(display);
     38PCUT_IMPORT(ievent);
    3839PCUT_IMPORT(seat);
    3940PCUT_IMPORT(window);
  • uspace/srv/hid/display/types/display/display.h

    rb3b79981 r6fbd1f9  
    11/*
    2  * Copyright (c) 2023 Jiri Svoboda
     2 * Copyright (c) 2024 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    3838
    3939#include <adt/list.h>
     40#include <fibril.h>
    4041#include <fibril_synch.h>
    4142#include <gfx/color.h>
     
    9394        list_t idevcfgs;
    9495
     96        /** Queue of input events */
     97        list_t ievents;
     98
     99        /** Input event processing fibril ID */
     100        fid_t ievent_fid;
     101        /** Input event condition variable */
     102        fibril_condvar_t ievent_cv;
     103        /** Signal input event fibril to quit */
     104        bool ievent_quit;
     105        /** Input event fibril terminated */
     106        bool ievent_done;
     107
    95108        /** Background color */
    96109        gfx_color_t *bg_color;
Note: See TracChangeset for help on using the changeset viewer.