Changeset 5271e4c in mainline for uspace/srv/hid/display/display.c


Ignore:
Timestamp:
2020-06-22T12:20:42Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
195b7b3
Parents:
66a408f7
git-author:
Jiri Svoboda <jiri@…> (2020-06-21 15:20:18)
git-committer:
Jiri Svoboda <jiri@…> (2020-06-22 12:20:42)
Message:

Duplicate rendering to additional output devices using a cloning GC

This gives the display server a pretty good illusion of rendering to just
one output device, while supporting multiple. This makes RFB work properly.

File:
1 edited

Legend:

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

    r66a408f7 r5271e4c  
    4242#include <stdlib.h>
    4343#include "client.h"
     44#include "clonegc.h"
    4445#include "cursimg.h"
    4546#include "cursor.h"
     
    505506                disp->rect = ddev->info.rect;
    506507
     508                /* Create cloning GC */
     509                rc = ds_clonegc_create(ddev->gc, &disp->fbgc);
     510                if (rc != EOK) {
     511                        // XXX Remove output
     512                        return ENOMEM;
     513                }
     514
    507515                /* Allocate backbuffer */
    508516                rc = ds_display_alloc_backbuf(disp);
     517                if (rc != EOK) {
     518                        // XXX Remove output
     519                        // XXX Delete clone GC
     520                        goto error;
     521                }
     522        } else {
     523                /* Add new output device to cloning GC */
     524                rc = ds_clonegc_add_output(disp->fbgc, ddev->gc);
    509525                if (rc != EOK)
    510526                        goto error;
     
    596612static gfx_context_t *ds_display_get_unbuf_gc(ds_display_t *display)
    597613{
    598         ds_ddev_t *ddev;
    599 
    600         /*
    601          * XXX To properly support multiple display devices, create
    602          * a cloning GC that copies rendering operation to each output.
    603          */
    604         ddev = ds_display_first_ddev(display);
    605         if (ddev == NULL)
    606                 return NULL;
    607 
    608         return ddev->gc;
     614        /* In case of unit tests */
     615        if (display->fbgc == NULL)
     616                return NULL;
     617
     618        return ds_clonegc_get_ctx(display->fbgc);
    609619}
    610620
Note: See TracChangeset for help on using the changeset viewer.