};
#ifdef CONFIG_MARU
-#if 0
-#ifdef CONFIG_GL_BACKEND
/* virtio-gl-pci */
static int virtio_gl_pci_init(VirtIOPCIProxy *vpci_dev)
static void virtio_gl_pci_class_init(ObjectClass *klass, void *data)
{
-// DeviceClass *dc = DEVICE_CLASS(klass);
VirtioPCIClass *k = VIRTIO_PCI_CLASS(klass);
PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass);
.name = TYPE_VIRTIO_GL_PCI,
.parent = TYPE_VIRTIO_PCI,
.instance_size = sizeof(VirtIOPCIProxy),
- .instance_init = sizeof(VirtIOGL),
+ .instance_init = virtio_gl_pci_instance_init,
.class_init = virtio_gl_pci_class_init,
};
-#endif
-#endif
/* virtio-touchscreen-pci */
type_register_static(&vhost_scsi_pci_info);
#endif
#ifdef CONFIG_MARU
-#if 0
-#ifdef CONFIG_GL_BACKEND
- type_register_static(&virtio_gl_pci_info);
-#endif
-#endif
type_register_static(&virtio_evdi_pci_info);
type_register_static(&virtio_esm_pci_info);
type_register_static(&virtio_hwkey_pci_info);
type_register_static(&virtio_keyboard_pci_info);
type_register_static(&virtio_touchscreen_pci_info);
+ type_register_static(&virtio_gl_pci_info);
#endif
}
#include "../tizen/src/hw/maru_virtio_hwkey.h"
#include "../tizen/src/hw/maru_virtio_keyboard.h"
#include "../tizen/src/hw/maru_virtio_touchscreen.h"
+#include "../tizen/src/hw/virtio-gl.h"
#endif
typedef struct VirtIOPCIProxy VirtIOPCIProxy;
typedef struct VirtIORngPCI VirtIORngPCI;
#ifdef CONFIG_MARU
-#ifdef CONFIG_GL_BACKEND
-// typedef struct VirtIOGLPCI VirtIOGLPCI;
-#endif
+typedef struct VirtIOGLPCI VirtIOGLPCI;
typedef struct VirtIOTouchscreenPCI VirtIOTouchscreenPCI;
typedef struct VirtIOEVDIPCI VirtIOEVDIPCI;
typedef struct VirtIOESMPCI VirtIOESMPCI;
};
#ifdef CONFIG_MARU
-#ifdef CONFIG_GL_BACKEND
-#if 0
/*
* virtio-gl-pci: This extends VirtioPCIProxy.
*/
VirtIOPCIProxy parent_obj;
VirtIOGL vdev;
};
-#endif
-#endif
/*
* virtio-touchscreen-pci: This extends VirtioPCIProxy.
#define PCI_DEVICE_ID_VIRTIO_SCSI 0x1004
#define PCI_DEVICE_ID_VIRTIO_RNG 0x1005
#define PCI_DEVICE_ID_VIRTIO_9P 0x1009
-#ifdef CONFIG_MARU
-#define PCI_DEVICE_ID_VIRTIO_GL 0x1006
-#endif
#define PCI_VENDOR_ID_REDHAT 0x1b36
#define PCI_DEVICE_ID_REDHAT_BRIDGE 0x0001
#define PCI_DEVICE_ID_VIRTIO_KEYBOARD 0x1020
#define PCI_DEVICE_ID_VIRTIO_ESM 0x1024
#define PCI_DEVICE_ID_VIRTIO_HWKEY 0x1028
-#define PCI_DEVICE_ID_VIRTIO_EVDI 0x1028
+#define PCI_DEVICE_ID_VIRTIO_EVDI 0x1032
+#define PCI_DEVICE_ID_VIRTIO_GL 0x1036
/* Virtio */
/*
#define VIRTIO_ID_ESM 13
#define VIRTIO_ID_HWKEY 14
#define VIRTIO_ID_EVDI 15
+#define VIRTIO_ID_GL 16
#endif /* MARU_DEVICE_IDS_H_ */
* THE SOFTWARE.
*/
+#if 0
#include "hw.h"
-#include "virtio.h"
+#include "maru_device_ids.h"
typedef target_phys_addr_t arg_t;
#include "opengl_process.h"
#include "tizen/src/debug_ch.h"
MULTI_DEBUG_CHANNEL(qemu, virtio-gl);
+#define TYPE_VIRTIO_GL "virtio-gl"
+
int decode_call_int(ProcessStruct *p, char *in_args, int args_len, char *r_buffer);
/* Uncomment to enable debugging - WARNING!!! changes ABI! */
#define SIZE_IN_HEADER 4
#endif
+#endif
+#include "virtio-gl.h"
+
static void virtio_gl_handle(VirtIODevice *vdev, VirtQueue *vq)
{
VirtQueueElement elem;
{
VirtIOGL *s;
- s = (VirtIOGL *)virtio_common_init("virtio-gl", VIRTIO_ID_GL,
- 0, sizeof(VirtIOGL));
- if (!s)
+ s = g_malloc0(sizeof(VirtIOGL));
+ virtio_init(&s->vdev, TYPE_VIRTIO_GL, VIRTIO_ID_GL, 0);
+ if (&s->vdev == NULL) {
+ ERR("Failed to initialize virtio gl device.\n");
return NULL;
+ }
+
+ VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(&s->vdev);
+ vdc->get_features = virtio_gl_get_features;
- s->vdev.get_features = virtio_gl_get_features;
s->vq = virtio_add_queue(&s->vdev, 128, virtio_gl_handle);
- register_savevm(dev, "virtio-gl", -1, 1, virtio_gl_save, virtio_gl_load, s);
+ register_savevm(dev, TYPE_VIRTIO_GL, -1, 1, virtio_gl_save, virtio_gl_load, s);
return &s->vdev;
}
--- /dev/null
+#ifndef VIRTIO_GL_H_
+#define VIRTIO_GL_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "hw/hw.h"
+#include "maru_device_ids.h"
+
+//typedef target_phys_addr_t arg_t;
+#include "opengl_process.h"
+#include "opengl_exec.h"
+#include <sys/time.h>
+
+#include "tizen/src/debug_ch.h"
+MULTI_DEBUG_CHANNEL(qemu, virtio-gl);
+
+#define TYPE_VIRTIO_GL "virtio-gl"
+
+int decode_call_int(ProcessStruct *p, char *in_args, int args_len, char *r_buffer);
+
+/* Uncomment to enable debugging - WARNING!!! changes ABI! */
+//#define DEBUG_GLIO
+
+typedef struct VirtIOGL
+{
+ VirtIODevice vdev;
+ VirtQueue *vq;
+} VirtIOGL;
+
+struct d_hdr
+{
+ int pid;
+ int rq_l;
+ int rrq_l;
+#ifdef DEBUG_GLIO
+ int sum;
+#endif
+};
+
+#define SIZE_OUT_HEADER sizeof(struct d_hdr)
+
+#ifdef DEBUG_GLIO
+#define SIZE_IN_HEADER (4*2)
+#else
+#define SIZE_IN_HEADER 4
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* VIRTIO_GL_H_ */