Changeset 0b63dc2 in mainline for uspace/lib/ddev/src


Ignore:
Timestamp:
2019-12-07T20:26:28Z (6 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
df1a019
Parents:
71cbe5c
Message:

Switch compositor → display server

Convert KFB from visualizer to display device interface. Add ability
of display device implementor to provide client with arg2, arg3 needed
to connect to GC.

Location:
uspace/lib/ddev/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ddev/src/ddev.c

    r71cbe5c r0b63dc2  
    8888        async_sess_t *sess;
    8989        async_exch_t *exch;
     90        sysarg_t arg2;
     91        sysarg_t arg3;
    9092        ipc_gc_t *gc;
    9193        errno_t rc;
    9294
    9395        exch = async_exchange_begin(ddev->sess);
    94         sess = async_connect_me_to(exch, INTERFACE_GC, 0, 42);
    95         if (sess == NULL) {
    96                 async_exchange_end(exch);
     96        rc = async_req_0_2(exch, DDEV_GET_GC, &arg2, &arg3);
     97        sess = async_connect_me_to(exch, INTERFACE_GC, arg2, arg3);
     98        async_exchange_end(exch);
     99
     100        if (sess == NULL)
    97101                return EIO;
    98         }
    99 
    100         async_exchange_end(exch);
    101102
    102103        rc = ipc_gc_create(sess, &gc);
  • uspace/lib/ddev/src/ddev_srv.c

    r71cbe5c r0b63dc2  
    4545#include <stdio.h>
    4646
     47/** Connect to a GC.
     48 *
     49 * XXX As a workaround here we tell the client the values of arg2 and arg3
     50 * needed to connect to the GC using async_connect_me_to(), these need
     51 * to be provided by the ddev_ops_t.get_gc. Different values are needed
     52 * for a DDF driver or a regular server. This would not be needed if we
     53 * had a proper way of creating an endpoint and passing it to our client.
     54 */
     55static void ddev_get_gc_srv(ddev_srv_t *srv, ipc_call_t *icall)
     56{
     57        sysarg_t arg2;
     58        sysarg_t arg3;
     59        errno_t rc;
     60
     61        printf("ddev_get_gc_srv\n");
     62
     63        if (srv->ops->get_gc == NULL) {
     64                async_answer_0(icall, ENOTSUP);
     65                return;
     66        }
     67
     68        rc = srv->ops->get_gc(srv->arg, &arg2, &arg3);
     69        async_answer_2(icall, rc, arg2, arg3);
     70}
     71
    4772void ddev_conn(ipc_call_t *icall, ddev_srv_t *srv)
    4873{
    4974        /* Accept the connection */
    5075        async_accept_0(icall);
    51         printf("display_conn\n");
     76        printf("ddev_conn\n");
    5277
    5378        while (true) {
     
    6691                switch (method) {
    6792                case DDEV_GET_GC:
     93                        ddev_get_gc_srv(srv, &call);
     94                        break;
    6895                default:
    6996                        async_answer_0(&call, ENOTSUP);
Note: See TracChangeset for help on using the changeset viewer.