/* Console hooks */
void goldfish_fb_set_rotation(int rotation)
{
    DeviceState *dev = qdev_find_recursive(sysbus_get_default(), TYPE_GOLDFISH_FB);
    if (dev) {
        struct goldfish_fb_state *s = GOLDFISH_FB(dev);
        DisplaySurface *ds = qemu_console_surface(s->con);
        s->rotation = rotation;
        s->need_update = 1;
        qemu_console_resize(s->con, surface_height(ds), surface_width(ds));
    } else {
        fprintf(stderr,"%s: unable to find FB dev\n", __func__);
    }
}
Exemple #2
0
static void platform_bus_create_devtree(PPCE500Params *params, void *fdt,
                                        const char *mpic)
{
    gchar *node = g_strdup_printf("/platform@%"PRIx64, params->platform_bus_base);
    const char platcomp[] = "qemu,platform\0simple-bus";
    uint64_t addr = params->platform_bus_base;
    uint64_t size = params->platform_bus_size;
    int irq_start = params->platform_bus_first_irq;
    PlatformBusDevice *pbus;
    DeviceState *dev;

    /* Create a /platform node that we can put all devices into */

    qemu_fdt_add_subnode(fdt, node);
    qemu_fdt_setprop(fdt, node, "compatible", platcomp, sizeof(platcomp));

    /* Our platform bus region is less than 32bit big, so 1 cell is enough for
       address and size */
    qemu_fdt_setprop_cells(fdt, node, "#size-cells", 1);
    qemu_fdt_setprop_cells(fdt, node, "#address-cells", 1);
    qemu_fdt_setprop_cells(fdt, node, "ranges", 0, addr >> 32, addr, size);

    qemu_fdt_setprop_phandle(fdt, node, "interrupt-parent", mpic);

    dev = qdev_find_recursive(sysbus_get_default(), TYPE_PLATFORM_BUS_DEVICE);
    pbus = PLATFORM_BUS_DEVICE(dev);

    /* We can only create dt nodes for dynamic devices when they're ready */
    if (pbus->done_gathering) {
        PlatformDevtreeData data = {
            .fdt = fdt,
            .mpic = mpic,
            .irq_start = irq_start,
            .node = node,
            .pbus = pbus,
        };

        /* Loop through all dynamic sysbus devices and create nodes for them */
        foreach_dynamic_sysbus_device(sysbus_device_create_devtree, &data);
    }