Changeset 87a7cdb in mainline for uspace/srv/hid/display/display.c


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

Enumerate display devices for output, RFB conversion (WIP)

Currently we can only have one active output device. Bitmaps
do not work as ipcgfx does not accept alloc != NULL.
Need to fill in tests.

File:
1 edited

Legend:

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

    r973efd36 r87a7cdb  
    5858
    5959        list_initialize(&disp->clients);
    60         disp->gc = gc;
    6160        disp->next_wnd_id = 1;
     61        list_initialize(&disp->ddevs);
    6262        list_initialize(&disp->seats);
    6363        list_initialize(&disp->windows);
     
    347347}
    348348
     349/** Add display device to display.
     350 *
     351 * @param disp Display
     352 * @param ddev Display device
     353 */
     354void ds_display_add_ddev(ds_display_t *disp, ds_ddev_t *ddev)
     355{
     356        assert(ddev->display == NULL);
     357        assert(!link_used(&ddev->lddevs));
     358
     359        ddev->display = disp;
     360        list_append(&ddev->lddevs, &disp->ddevs);
     361}
     362
     363/** Remove display device from display.
     364 *
     365 * @param ddev Display device
     366 */
     367void ds_display_remove_ddev(ds_ddev_t *ddev)
     368{
     369        list_remove(&ddev->lddevs);
     370        ddev->display = NULL;
     371}
     372
     373/** Get first display device in display.
     374 *
     375 * @param disp Display
     376 * @return First display device or @c NULL if there is none
     377 */
     378ds_ddev_t *ds_display_first_ddev(ds_display_t *disp)
     379{
     380        link_t *link = list_first(&disp->ddevs);
     381
     382        if (link == NULL)
     383                return NULL;
     384
     385        return list_get_instance(link, ds_ddev_t, lddevs);
     386}
     387
     388/** Get next display device in display.
     389 *
     390 * @param ddev Current display device
     391 * @return Next display device or @c NULL if there is none
     392 */
     393ds_ddev_t *ds_display_next_ddev(ds_ddev_t *ddev)
     394{
     395        link_t *link = list_next(&ddev->lddevs, &ddev->display->ddevs);
     396
     397        if (link == NULL)
     398                return NULL;
     399
     400        return list_get_instance(link, ds_ddev_t, lddevs);
     401}
     402
     403// XXX
     404gfx_context_t *ds_display_get_gc(ds_display_t *display)
     405{
     406        ds_ddev_t *ddev;
     407
     408        ddev = ds_display_first_ddev(display);
     409        if (ddev == NULL)
     410                abort();
     411
     412        return ddev->gc;
     413}
     414
    349415/** @}
    350416 */
Note: See TracChangeset for help on using the changeset viewer.