Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 959b7ec in mainline


Ignore:
Timestamp:
2019-11-06T18:10:54Z (16 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
e422ff6
Parents:
648e2ac
Message:

Start adding tests for libdisplay and fix display_close

So far we test display_open() and display_close().
display_conn was not closing the callback session, which led
to display_close waiting indefinitely.

Location:
uspace
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/display/include/disp_srv.h

    r648e2ac r959b7ec  
    5656
    5757extern void display_conn(ipc_call_t *, display_srv_t *);
     58extern void display_srv_initialize(display_srv_t *);
    5859extern void display_srv_ev_pending(display_srv_t *);
    5960
  • uspace/lib/display/include/types/display.h

    r648e2ac r959b7ec  
    6161} display_wnd_cb_t;
    6262
    63 typedef struct {
    64         kbd_event_t kbd_event;
    65 } display_wnd_ev_t;
    66 
    6763/** Display window */
    6864typedef struct {
  • uspace/lib/display/meson.build

    r648e2ac r959b7ec  
    3030src = files(
    3131        'src/display.c',
    32         'src/disp_srv.c'
     32        'src/disp_srv.c',
    3333)
     34
     35test_src = files(
     36        'test/display.c',
     37        'test/main.c',
     38)
  • uspace/lib/display/src/disp_srv.c

    r648e2ac r959b7ec  
    4040#include <io/log.h>
    4141#include <ipc/display.h>
     42#include <mem.h>
    4243#include <stdlib.h>
    4344#include <stddef.h>
     
    169170                }
    170171        }
     172
     173        /* Hang up callback session */
     174        if (srv->client_sess != NULL) {
     175                async_hangup(srv->client_sess);
     176                srv->client_sess = NULL;
     177        }
     178}
     179
     180/** Initialize display server structure
     181 *
     182 * @param srv Display server structure to initialize
     183 */
     184void display_srv_initialize(display_srv_t *srv)
     185{
     186        memset(srv, 0, sizeof(*srv));
    171187}
    172188
  • uspace/lib/display/src/display.c

    r648e2ac r959b7ec  
    2929#include <async.h>
    3030#include <display.h>
     31#include <display/event.h>
    3132#include <errno.h>
    3233#include <fibril_synch.h>
     
    5758                return ENOMEM;
    5859
     60        fibril_mutex_initialize(&display->lock);
     61        fibril_condvar_initialize(&display->cv);
    5962        list_initialize(&display->windows);
    6063
  • uspace/srv/hid/display/main.c

    r648e2ac r959b7ec  
    156156
    157157                /* Set up protocol structure */
     158                display_srv_initialize(&srv);
    158159                srv.ops = &display_srv_ops;
    159160                srv.arg = client;
Note: See TracChangeset for help on using the changeset viewer.