Changeset 71cbe5c in mainline for uspace/lib/ipcgfx/src/client.c


Ignore:
Timestamp:
2019-12-06T17:48:48Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0b63dc2
Parents:
87a7cdb
Message:

Make bitmaps work with IPC GC / RFB

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ipcgfx/src/client.c

    r87a7cdb r71cbe5c  
    123123        gfx_coord2_t dim;
    124124        async_exch_t *exch = NULL;
     125        as_area_info_t info;
    125126        ipc_call_t answer;
     127        size_t asize;
    126128        aid_t req;
    127129        errno_t rc;
     
    148150        } else {
    149151                /*
    150                  * XXX We could allow this if the pixels point to a shareable
    151                  * area or we could do a copy of the data when rendering
     152                 * Accept user allocation if it points to a an acceptable
     153                 * memory area.
    152154                 */
    153                 rc = ENOTSUP;
    154                 goto error;
     155                rc = as_area_get_info(alloc->pixels, &info);
     156                if (rc != EOK)
     157                        goto error;
     158
     159                /* Pixels should start at the beginning of the area */
     160                if (info.start_addr != (uintptr_t) alloc->pixels) {
     161                        rc = EINVAL;
     162                        goto error;
     163                }
     164
     165                /* Size of area should be size of bitmap rounded up to page size */
     166                asize = PAGES2SIZE(SIZE2PAGES(alloc->pitch * dim.y));
     167                if (info.size != asize) {
     168                        rc = EINVAL;
     169                        goto error;
     170                }
     171
     172                ipcbm->alloc = *alloc;
    155173        }
    156174
Note: See TracChangeset for help on using the changeset viewer.