1/*
2 * Copyright 2008 Red Hat, Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * on the rights to use, copy, modify, merge, publish, distribute, sub
8 * license, and/or sell copies of the Software, and to permit persons to whom
9 * the Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
18 * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 */
22
23#ifndef QXL_H
24#define QXL_H
25
26#include <stdint.h>
27
28#include <spice/qxl_dev.h>
29#ifdef XSPICE
30#include <spice.h>
31#endif
32
33#include "compiler.h"
34#include "xf86.h"
35#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
36#include "xf86Resources.h"
37#endif
38#include "xf86Cursor.h"
39#include "xf86_OSproc.h"
40#ifdef XV
41#include "xf86xv.h"
42#endif
43#include "xf86Crtc.h"
44#include "shadow.h"
45#include "micmap.h"
46#include "uxa/uxa.h"
47
48#include "list.h"
49#ifndef XSPICE
50#ifdef XSERVER_PCIACCESS
51#include "pciaccess.h"
52#endif
53#ifdef XSERVER_PLATFORM_BUS
54#include "xf86platformBus.h"
55#endif
56#include "fb.h"
57#include "vgaHW.h"
58#endif /* XSPICE */
59
60#include "qxl_drmmode.h"
61
62#if (XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 11, 99, 903, 0))
63typedef struct list xorg_list_t;
64#define xorg_list_init              list_init
65#define xorg_list_add               list_add
66#define xorg_list_del               list_del
67#define xorg_list_for_each_entry    list_for_each_entry
68#else
69typedef struct xorg_list xorg_list_t;
70#endif
71
72struct xf86_platform_device;
73
74#include "compat-api.h"
75#define hidden _X_HIDDEN
76
77#ifdef XSPICE
78#define QXL_NAME		"spiceqxl"
79#define QXL_DRIVER_NAME		"spiceqxl"
80#else
81#define QXL_NAME		"qxl"
82#define QXL_DRIVER_NAME		"qxl"
83#endif
84#define PCI_VENDOR_RED_HAT	0x1b36
85
86#define PCI_CHIP_QXL_0100	0x0100
87#define PCI_CHIP_QXL_01FF	0x01ff
88
89#pragma pack(push,1)
90
91struct qxl_ring_header {
92    uint32_t num_items;
93    uint32_t prod;
94    uint32_t notify_on_prod;
95    uint32_t cons;
96    uint32_t notify_on_cons;
97};
98
99#pragma pack(pop)
100typedef struct surface_cache_t surface_cache_t;
101
102typedef struct _qxl_screen_t qxl_screen_t;
103
104typedef struct
105{
106    uint8_t	generation;
107    uint64_t	start_phys_addr;
108    uint64_t	end_phys_addr;
109    uint64_t	start_virt_addr;
110    uint64_t	end_virt_addr;
111    uint64_t	high_bits;
112} qxl_memslot_t;
113
114typedef struct qxl_surface_t qxl_surface_t;
115
116/*
117 * Config Options
118 */
119
120enum {
121    OPTION_ENABLE_IMAGE_CACHE = 0,
122    OPTION_ENABLE_FALLBACK_CACHE,
123    OPTION_ENABLE_SURFACES,
124    OPTION_DEBUG_RENDER_FALLBACKS,
125    OPTION_NUM_HEADS,
126    OPTION_SPICE_DEFERRED_FPS,
127#ifdef XSPICE
128    OPTION_SPICE_PORT,
129    OPTION_SPICE_TLS_PORT,
130    OPTION_SPICE_ADDR,
131    OPTION_SPICE_X509_DIR,
132    OPTION_SPICE_SASL,
133    OPTION_SPICE_AGENT_MOUSE,
134    OPTION_SPICE_DISABLE_TICKETING,
135    OPTION_SPICE_PASSWORD,
136    OPTION_SPICE_X509_KEY_FILE,
137    OPTION_SPICE_STREAMING_VIDEO,
138    OPTION_SPICE_PLAYBACK_COMPRESSION,
139    OPTION_SPICE_ZLIB_GLZ_WAN_COMPRESSION,
140    OPTION_SPICE_JPEG_WAN_COMPRESSION,
141    OPTION_SPICE_IMAGE_COMPRESSION,
142    OPTION_SPICE_DISABLE_COPY_PASTE,
143    OPTION_SPICE_IPV4_ONLY,
144    OPTION_SPICE_IPV6_ONLY,
145    OPTION_SPICE_X509_CERT_FILE,
146    OPTION_SPICE_X509_KEY_PASSWORD,
147    OPTION_SPICE_TLS_CIPHERS,
148    OPTION_SPICE_CACERT_FILE,
149    OPTION_SPICE_DH_FILE,
150    OPTION_SPICE_EXIT_ON_DISCONNECT,
151    OPTION_SPICE_PLAYBACK_FIFO_DIR,
152    OPTION_SPICE_VDAGENT_ENABLED,
153    OPTION_SPICE_VDAGENT_VIRTIO_PATH,
154    OPTION_SPICE_VDAGENT_UINPUT_PATH,
155    OPTION_SPICE_VDAGENT_UID,
156    OPTION_SPICE_VDAGENT_GID,
157    OPTION_FRAME_BUFFER_SIZE,
158    OPTION_SURFACE_BUFFER_SIZE,
159    OPTION_COMMAND_BUFFER_SIZE,
160    OPTION_SPICE_SMARTCARD_FILE,
161    OPTION_SPICE_VIDEO_CODECS,
162#endif
163    OPTION_COUNT,
164};
165
166enum {
167    QXL_DEVICE_PRIMARY_UNDEFINED,
168    QXL_DEVICE_PRIMARY_NONE,
169    QXL_DEVICE_PRIMARY_CREATED,
170};
171
172struct qxl_bo;
173/*
174 * for relocations
175 * dst_bo + dst_offset are the bo and offset into which the reloc is being written,
176 * src_bo is the bo who's offset is being relocated.
177 */
178struct qxl_bo_funcs {
179    struct qxl_bo *(*bo_alloc)(qxl_screen_t *qxl, unsigned long size, const char *name);
180    struct qxl_bo *(*cmd_alloc)(qxl_screen_t *qxl, unsigned long size, const char *name);
181    void *(*bo_map)(struct qxl_bo *bo);
182    void (*bo_unmap)(struct qxl_bo *bo);
183    void (*bo_decref)(qxl_screen_t *qxl, struct qxl_bo *bo);
184    void (*bo_incref)(qxl_screen_t *qxl, struct qxl_bo *bo);
185    void (*bo_output_bo_reloc)(qxl_screen_t *qxl, uint32_t dst_offset,
186			       struct qxl_bo *dst_bo, struct qxl_bo *src_bo);
187    void (*write_command)(qxl_screen_t *qxl, uint32_t type, struct qxl_bo *bo);
188    void (*update_area)(qxl_surface_t *surf, int x1, int y1, int x2, int y2);
189    struct qxl_bo *(*create_primary)(qxl_screen_t *qxl, uint32_t width, uint32_t height, int32_t stride, uint32_t format);
190    void (*destroy_primary)(qxl_screen_t *qxl, struct qxl_bo *primary_bo);
191
192    qxl_surface_t *(*create_surface)(qxl_screen_t *qxl, int width,
193				     int height, int bpp);
194    void (*destroy_surface)(qxl_surface_t *surf);
195
196    void (*bo_output_surf_reloc)(qxl_screen_t *qxl, uint32_t dst_offset,
197				 struct qxl_bo *dst_bo,
198				 qxl_surface_t *surf);
199  /* surface create / destroy */
200};
201
202void qxl_ums_setup_funcs(qxl_screen_t *qxl);
203void qxl_kms_setup_funcs(qxl_screen_t *qxl);
204
205/* ums specific functions */
206struct qxl_bo *qxl_ums_surf_mem_alloc(qxl_screen_t *qxl, uint32_t size);
207struct qxl_bo *qxl_ums_lookup_phy_addr(qxl_screen_t *qxl, uint64_t phy_addr);
208
209typedef struct FrameTimer FrameTimer;
210typedef void (*FrameTimerFunc)(void *opaque);
211
212#ifdef XF86DRM_MODE
213#define MAX_RELOCS 96
214#include "qxl_drm.h"
215
216struct qxl_cmd_stream {
217  struct qxl_bo *reloc_bo[MAX_RELOCS];
218  int n_reloc_bos;
219  struct drm_qxl_reloc relocs[MAX_RELOCS];
220  int n_relocs;
221};
222#endif
223
224struct _qxl_screen_t
225{
226    /* These are the names QXL uses */
227    void *			ram;	/* Command RAM */
228    void *			ram_physical;
229    void *			vram;	/* Surface RAM */
230    void *			vram_physical;
231    struct QXLRom *		rom;    /* Parameter RAM */
232
233    struct qxl_ring *		command_ring;
234    struct qxl_ring *		cursor_ring;
235    struct qxl_ring *		release_ring;
236
237    Bool                        screen_resources_created;
238    int                         device_primary;
239    struct qxl_bo *             primary_bo;
240    int				num_modes;
241    struct QXLMode *		modes;
242    int				io_base;
243    void *			surface0_area;
244    long			surface0_size;
245    long			vram_size;
246    long			ram_size;
247
248    DisplayModePtr              x_modes;
249
250    int				virtual_x;
251    int				virtual_y;
252
253    /* not the same as the heads mode for #head > 1 or virtual != head size */
254    struct QXLMode 		primary_mode;
255    qxl_surface_t *		primary;
256
257    struct QXLMonitorsConfig   *monitors_config;
258    int                         monitors_config_size;
259    int                         mem_size;
260
261    int				bytes_per_pixel;
262
263    /* Commands */
264    struct qxl_mem *		mem;   /* Context for qxl_alloc/free */
265
266    /* Surfaces */
267    struct qxl_mem *		surf_mem;  /* Context for qxl_surf_alloc/free */
268
269    EntityInfoPtr		entity;
270
271    int                         num_heads;
272    xf86CrtcPtr *               crtcs;
273    xf86OutputPtr *             outputs;
274
275#ifndef XSPICE
276#ifdef XSERVER_LIBPCIACCESS
277    struct pci_device *		pci;
278    struct pci_io_handle *	io;
279#else
280    pciVideoPtr			pci;
281    PCITAG			pci_tag;
282#endif
283    struct xf86_platform_device *platform_dev;
284    vgaRegRec                   vgaRegs;
285#endif /* XSPICE */
286
287    uxa_driver_t *		uxa;
288
289    CreateScreenResourcesProcPtr create_screen_resources;
290    CloseScreenProcPtr		close_screen;
291    CreateGCProcPtr		create_gc;
292    CopyWindowProcPtr		copy_window;
293
294    int16_t			cur_x;
295    int16_t			cur_y;
296    int16_t			hot_x;
297    int16_t			hot_y;
298
299    ScrnInfoPtr			pScrn;
300
301    qxl_memslot_t *		mem_slots;
302    uint8_t			n_mem_slots;
303
304    uint8_t			main_mem_slot;
305    uint8_t			slot_id_bits;
306    uint8_t			slot_gen_bits;
307    uint64_t			va_slot_mask;
308
309    uint8_t			vram_mem_slot;
310
311    surface_cache_t *		surface_cache;
312
313    /* Evacuated surfaces are stored here during VT switches */
314    void *			vt_surfaces;
315
316    OptionInfoRec	options[OPTION_COUNT + 1];
317
318    int				enable_image_cache;
319    int				enable_fallback_cache;
320    int				enable_surfaces;
321    int                         debug_render_fallbacks;
322
323    FrameTimer *        frames_timer;
324
325#ifdef XSPICE
326    /* XSpice specific */
327    struct QXLRom		shadow_rom;    /* Parameter RAM */
328    SpiceServer *       spice_server;
329    SpiceCoreInterface *core;
330
331    QXLWorker *         worker;
332    int                 worker_running;
333    QXLInstance         display_sin;
334    SpicePlaybackInstance playback_sin;
335    /* XSpice specific, dragged from the Device */
336    QXLReleaseInfo     *last_release;
337
338    uint32_t           cmdflags;
339    uint32_t           oom_running;
340    uint32_t           num_free_res; /* is having a release ring effective
341                                        for Xspice? */
342    /* This is only touched from red worker thread - do not access
343     * from Xorg threads. */
344    struct guest_primary {
345        QXLSurfaceCreate surface;
346        uint32_t       commands;
347        uint32_t       resized;
348        int32_t        stride;
349        uint32_t       bits_pp;
350        uint32_t       bytes_pp;
351        uint8_t        *data, *flipped;
352    } guest_primary;
353
354    char playback_fifo_dir[PATH_MAX];
355    void *playback_opaque;
356    char smartcard_file[PATH_MAX];
357#endif /* XSPICE */
358
359    uint32_t deferred_fps;
360    xorg_list_t ums_bos;
361    struct qxl_bo_funcs *bo_funcs;
362
363    Bool kms_enabled;
364#ifdef XF86DRM_MODE
365    drmmode_rec drmmode;
366    int drm_fd;
367    struct qxl_cmd_stream cmds;
368#endif
369
370};
371
372typedef struct qxl_output_private {
373    qxl_screen_t *qxl;
374    int           head;
375    xf86OutputStatus status;
376} qxl_output_private;
377
378typedef struct qxl_crtc_private {
379    qxl_screen_t *qxl;
380    int           head;
381    xf86OutputPtr output;
382} qxl_crtc_private;
383
384static inline uint64_t
385physical_address (qxl_screen_t *qxl, void *virtual, uint8_t slot_id)
386{
387    qxl_memslot_t *p_slot = &(qxl->mem_slots[slot_id]);
388
389    return p_slot->high_bits | ((unsigned long)virtual - p_slot->start_virt_addr);
390}
391
392static inline void *
393virtual_address (qxl_screen_t *qxl, void *physical, uint8_t slot_id)
394{
395    qxl_memslot_t *p_slot = &(qxl->mem_slots[slot_id]);
396    unsigned long virt;
397
398    virt = ((unsigned long)physical) & qxl->va_slot_mask;
399    virt += p_slot->start_virt_addr;
400
401    return (void *)virt;
402}
403
404static inline void *
405u64_to_pointer (uint64_t u)
406{
407    return (void *)(unsigned long)u;
408}
409
410static inline uint64_t
411pointer_to_u64 (void *p)
412{
413    return (uint64_t)(unsigned long)p;
414}
415
416struct qxl_ring;
417
418/*
419 * HW cursor
420 */
421void              qxl_cursor_init        (ScreenPtr               pScreen);
422
423
424
425/*
426 * Rings
427 */
428struct qxl_ring * qxl_ring_create      (struct qxl_ring_header *header,
429					int                     element_size,
430					int                     n_elements,
431					int                     prod_notify,
432					qxl_screen_t            *qxl);
433void              qxl_ring_push        (struct qxl_ring        *ring,
434					const void             *element);
435Bool              qxl_ring_pop         (struct qxl_ring        *ring,
436					void                   *element);
437void              qxl_ring_wait_idle   (struct qxl_ring        *ring);
438
439void              qxl_ring_request_notify (struct qxl_ring *ring);
440
441int               qxl_ring_prod        (struct qxl_ring        *ring);
442int               qxl_ring_cons        (struct qxl_ring        *ring);
443
444/*
445 * Surface
446 */
447surface_cache_t *   qxl_surface_cache_create (qxl_screen_t *qxl);
448qxl_surface_t *	    qxl_surface_cache_create_primary (qxl_screen_t *qxl,
449						struct QXLMode *mode);
450void *              qxl_surface_get_host_bits(qxl_surface_t *surface);
451qxl_surface_t *	    qxl_surface_create (qxl_screen_t *qxl,
452					int	      width,
453					int	      height,
454					int	      bpp);
455void
456qxl_surface_cache_sanity_check (surface_cache_t *qxl);
457void *
458qxl_surface_cache_evacuate_all (surface_cache_t *qxl);
459void
460qxl_surface_cache_replace_all (surface_cache_t *qxl, void *data);
461
462void		    qxl_surface_set_pixmap (qxl_surface_t *surface,
463					    PixmapPtr      pixmap);
464/* Call this to indicate that the server is done with the surface */
465void		    qxl_surface_kill (qxl_surface_t *surface);
466/* Call this when a notification comes back from the device
467 * that the surface has been destroyed
468 */
469void		    qxl_surface_recycle (surface_cache_t *cache, uint32_t id);
470
471/* send anything pending to the other side */
472void		    qxl_surface_flush (qxl_surface_t *surface);
473
474/* access */
475Bool		    qxl_surface_prepare_access (qxl_surface_t *surface,
476						PixmapPtr      pixmap,
477						RegionPtr      region,
478						uxa_access_t   access);
479void		    qxl_surface_finish_access (qxl_surface_t *surface,
480					       PixmapPtr      pixmap);
481
482/* solid */
483Bool		    qxl_surface_prepare_solid (qxl_surface_t *destination,
484					       Pixel	      fg);
485void		    qxl_surface_solid         (qxl_surface_t *destination,
486					       int	      x1,
487					       int	      y1,
488					       int	      x2,
489					       int	      y2);
490
491/* copy */
492Bool		    qxl_surface_prepare_copy (qxl_surface_t *source,
493					      qxl_surface_t *dest);
494void		    qxl_surface_copy	     (qxl_surface_t *dest,
495					      int  src_x1, int src_y1,
496					      int  dest_x1, int dest_y1,
497					      int width, int height);
498Bool		    qxl_surface_put_image    (qxl_surface_t *dest,
499					      int x, int y, int width, int height,
500					      const char *src, int src_pitch);
501void		    qxl_surface_unref        (surface_cache_t *cache,
502					      uint32_t surface_id);
503
504/* composite */
505Bool		    qxl_surface_prepare_composite (int op,
506						   PicturePtr	src_picture,
507						   PicturePtr	mask_picture,
508						   PicturePtr   dst_picture,
509						   qxl_surface_t *src,
510						   qxl_surface_t *mask,
511						   qxl_surface_t *dest);
512void		   qxl_surface_composite (qxl_surface_t *dest,
513					  int src_x, int src_y,
514					  int mask_x, int mask_y,
515					  int dst_x, int dst_y,
516					  int width, int height);
517
518/* UXA */
519#if HAS_DEVPRIVATEKEYREC
520extern DevPrivateKeyRec uxa_pixmap_index;
521#else
522extern int uxa_pixmap_index;
523#endif
524Bool
525qxl_uxa_init (qxl_screen_t *qxl, ScreenPtr screen);
526
527static inline qxl_surface_t *get_surface (PixmapPtr pixmap)
528{
529#if HAS_DEVPRIVATEKEYREC
530    return dixGetPrivate(&pixmap->devPrivates, &uxa_pixmap_index);
531#else
532    return dixLookupPrivate(&pixmap->devPrivates, &uxa_pixmap_index);
533#endif
534}
535
536static inline void set_surface (PixmapPtr pixmap, qxl_surface_t *surface)
537{
538    dixSetPrivate(&pixmap->devPrivates, &uxa_pixmap_index, surface);
539}
540
541static inline struct QXLRam *
542get_ram_header (qxl_screen_t *qxl)
543{
544    return (struct QXLRam *)
545	((uint8_t *)qxl->ram + qxl->rom->ram_header_offset);
546}
547
548void qxl_surface_upload_primary_regions(qxl_screen_t *qxl, PixmapPtr pixmap, RegionRec *r);
549
550/* ums randr code */
551void qxl_init_randr (ScrnInfoPtr pScrn, qxl_screen_t *qxl);
552void qxl_initialize_x_modes (qxl_screen_t *qxl, ScrnInfoPtr pScrn,
553                        unsigned int *max_x, unsigned int *max_y);
554void qxl_update_edid (qxl_screen_t *qxl);
555Bool qxl_create_desired_modes (qxl_screen_t *qxl);
556
557Bool qxl_resize_primary (qxl_screen_t *qxl, uint32_t width, uint32_t height);
558void qxl_io_monitors_config_async (qxl_screen_t *qxl);
559void qxl_allocate_monitors_config (qxl_screen_t *qxl);
560/*
561 * Images
562 */
563struct qxl_bo *qxl_image_create     (qxl_screen_t           *qxl,
564				       const uint8_t          *data,
565				       int                     x,
566				       int                     y,
567				       int                     width,
568				       int                     height,
569				       int                     stride,
570				       int                     Bpp,
571				       Bool		       fallback);
572void              qxl_image_destroy    (qxl_screen_t           *qxl,
573				        struct qxl_bo *bo);
574
575/*
576 * Malloc
577 */
578void              qxl_mem_init(void);
579int		  qxl_handle_oom (qxl_screen_t *qxl);
580struct qxl_mem *  qxl_mem_create       (void                   *base,
581					unsigned long           n_bytes);
582void              qxl_mem_dump_stats   (struct qxl_mem         *mem,
583					const char             *header);
584void              qxl_mem_free_all     (struct qxl_mem         *mem);
585int		   qxl_garbage_collect (qxl_screen_t *qxl);
586
587void qxl_reset_and_create_mem_slots (qxl_screen_t *qxl);
588void qxl_mark_mem_unverifiable (qxl_screen_t *qxl);
589#ifdef DEBUG_QXL_MEM
590void qxl_mem_unverifiable(struct qxl_mem *mem);
591#else
592static inline void qxl_mem_unverifiable(struct qxl_mem *mem) {}
593#endif
594
595/*
596 * I/O port commands
597 */
598void qxl_update_area(qxl_screen_t *qxl);
599void qxl_io_memslot_add(qxl_screen_t *qxl, uint8_t id);
600void qxl_io_create_primary(qxl_screen_t *qxl);
601void qxl_io_destroy_primary(qxl_screen_t *qxl);
602void qxl_io_notify_oom(qxl_screen_t *qxl);
603void qxl_io_flush_surfaces(qxl_screen_t *qxl);
604void qxl_io_destroy_all_surfaces (qxl_screen_t *qxl);
605
606#ifdef QXLDRV_RESIZABLE_SURFACE0
607void qxl_io_flush_release (qxl_screen_t *qxl);
608#endif
609
610Bool qxl_pre_init_common(ScrnInfoPtr pScrn);
611Bool qxl_fb_init (qxl_screen_t *qxl, ScreenPtr pScreen);
612Bool qxl_screen_init_kms(SCREEN_INIT_ARGS_DECL);
613Bool qxl_enter_vt_kms (VT_FUNC_ARGS_DECL);
614void qxl_leave_vt_kms (VT_FUNC_ARGS_DECL);
615void qxl_set_screen_pixmap_header (ScreenPtr pScreen);
616Bool qxl_resize_primary_to_virtual (qxl_screen_t *qxl);
617void qxl_get_formats (int bpp, SpiceSurfaceFmt *format, pixman_format_code_t *pformat);
618
619#ifdef XF86DRM_MODE
620Bool qxl_pre_init_kms(ScrnInfoPtr pScrn, int flags);
621Bool qxl_kms_check_cap(qxl_screen_t *qxl, int cap);
622uint32_t qxl_kms_bo_get_handle(struct qxl_bo *_bo);
623#else
624static inline Bool qxl_pre_init_kms(ScrnInfoPtr pScrn, int flags) { return FALSE; }
625static inline Bool qxl_kms_check_cap(qxl_screen_t *qxl, int cap) { return FALSE; }
626#endif
627
628#ifdef XSPICE
629/* device to spice-server, now xspice to spice-server */
630void ioport_write(qxl_screen_t *qxl, uint32_t io_port, uint32_t val);
631#else
632static inline void ioport_write(qxl_screen_t *qxl, int port, int val)
633{
634    pci_io_write8(qxl->io, port, val);
635}
636#endif
637
638#ifdef XSPICE
639
640#define MEMSLOT_GROUP 0
641#define NUM_MEMSLOTS_GROUPS 1
642
643// Taken from qemu's qxl.c, not sure the values make sense? we
644// only have a single slot, and it is never changed after being added,
645// so not a problem?
646#define NUM_MEMSLOTS 8
647#define MEMSLOT_GENERATION_BITS 8
648#define MEMSLOT_SLOT_BITS 1
649
650// qemu/cpu-all.h
651#define TARGET_PAGE_SIZE (1 << TARGET_PAGE_BITS)
652// qemu/target-i386/cpu.h
653#define TARGET_PAGE_BITS 12
654
655#define NUM_SURFACES 1024
656
657/* initializes if required and returns the server singleton */
658SpiceServer *xspice_get_spice_server(void);
659
660#endif /* XSPICE */
661
662#ifdef WITH_CHECK_POINT
663#define CHECK_POINT() ErrorF ("%s: %d  (%s)\n", __FILE__, __LINE__, __FUNCTION__);
664#else
665#define CHECK_POINT()
666#endif
667
668
669#endif // QXL_H
670