<html><head></head><body>With agent running we do.<br><br><div class="gmail_quote">On August 22, 2014 7:55:19 AM EDT, "Marc-André Lureau" <mlureau@redhat.com> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">Hi Jeremy<br /><br />I wish we could have dynamic allocation for Xspice, avoiding those parameters, but this could be improved later. <br /><br />Few remarks below:<br /><br />----- Original Message -----<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> Also adjust the mode selection to fit, and add a few larger modes.<br /> <br /> Signed-off-by: Jeremy White <jwhite@codeweavers.com><br /> ---<br /> examples/spiceqxl.xorg.conf.example | 13 +++++++++++++<br /> src/qxl.h | 3 +++<br /> src/qxl_driver.c | 19 +++++++++++++++----<br /> src/spiceqxl_driver.c | 33 +++++++++++++++------------------<br /> src/spiceqxl_driver.h | 7 +++----<br /> 5 files changed, 49 insertions(+), 26 deletions(-)<br /> <br /> diff --git a/examples/spiceqxl.xorg.conf.example<br /> b/examples/spiceqxl.xorg.conf.example<br />
index be8a16b..8fd5d2f 100644<br /> --- a/examples/spiceqxl.xorg.conf.example<br /> +++ b/examples/spiceqxl.xorg.conf.example<br /> @@ -96,6 +96,19 @@ Section "Device"<br /> # defaults to 4<br /> #Option "NumHeads" "4"<br /> <br /> + # The amount of frame buffer ram, in megabytes, to allocate<br /> + # defaults to 16<br /> + #Option "FrameBufferSize" "16"<br /> +<br /> + # The amount of surface buffer ram, in megabytes, to allocate<br /> + # Must be larger than FrameBufferSize<br /></blockquote><br />Is there a runtime check for that?<br /><br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> + # defaults to 128<br /> + #Option "SurfaceBufferSize" "128"<br /> +<br /> + # The amount of command buffer ram, in megabytes, to allocate<br /> + # defaults to 128<br /> + #Option "CommandBufferSize" "128"<br /> +<br /> # Set Spice Agent Mouse<br /> # defaults to false<br
/> #Option "SpiceAgentMouse" "False"<br /> diff --git a/src/qxl.h b/src/qxl.h<br /> index 19555ba..fa9b13f 100644<br /> --- a/src/qxl.h<br /> +++ b/src/qxl.h<br /> @@ -154,6 +154,9 @@ enum {<br /> OPTION_SPICE_VDAGENT_UINPUT_PATH,<br /> OPTION_SPICE_VDAGENT_UID,<br /> OPTION_SPICE_VDAGENT_GID,<br /> + OPTION_FRAME_BUFFER_SIZE,<br /> + OPTION_SURFACE_BUFFER_SIZE,<br /> + OPTION_COMMAND_BUFFER_SIZE,<br /> #endif<br /> OPTION_COUNT,<br /> };<br /> diff --git a/src/qxl_driver.c b/src/qxl_driver.c<br /> index d9bf447..87cdca4 100644<br /> --- a/src/qxl_driver.c<br /> +++ b/src/qxl_driver.c<br /> @@ -146,6 +146,12 @@ const OptionInfoRec DefaultOptions[] =<br /> "SpiceVdagentUid", OPTV_INTEGER, {0}, FALSE},<br /> { OPTION_SPICE_VDAGENT_GID,<br /> "SpiceVdagentGid", OPTV_INTEGER, {0}, FALSE},<br /> + { OPTION_FRAME_BUFFER_SIZE,<br /> + "FrameBufferSize", OPTV_INTEGER,<br />
{DEFAULT_FRAME_BUFFER_SIZE}, FALSE},<br /> + { OPTION_SURFACE_BUFFER_SIZE,<br /> + "SurfaceBufferSize", OPTV_INTEGER,<br /> {DEFAULT_SURFACE_BUFFER_SIZE}, FALSE},<br /> + { OPTION_COMMAND_BUFFER_SIZE,<br /> + "CommandBufferSize", OPTV_INTEGER,<br /> {DEFAULT_COMMAND_BUFFER_SIZE}, FALSE},<br /> #endif<br /> <br /> { -1, NULL, OPTV_NONE, {0}, FALSE }<br /> @@ -190,11 +196,9 @@ unmap_memory_helper (qxl_screen_t *qxl)<br /> static void<br /> map_memory_helper (qxl_screen_t *qxl)<br /> {<br /> - qxl->ram = calloc (RAM_SIZE, 1);<br /> - qxl->ram_size = RAM_SIZE;<br /> + qxl->ram = calloc (qxl->ram_size, 1);<br /> qxl->ram_physical = qxl->ram;<br /> - qxl->vram = calloc (VRAM_SIZE, 1);<br /> - qxl->vram_size = VRAM_SIZE;<br /> + qxl->vram = calloc (qxl->vram_size, 1);<br /> qxl->vram_physical = qxl->vram;<br /> qxl->rom = calloc (ROM_SIZE, 1);<br /> <br /> @@ -1081,6
+1085,13 @@ qxl_pre_init (ScrnInfoPtr pScrn, int flags)<br /> strncpy(qxl->playback_fifo_dir, playback_fifo_dir,<br /> sizeof(qxl->playback_fifo_dir));<br /> else<br /> qxl->playback_fifo_dir[0] = '\0';<br /> +<br /> + qxl->surface0_size =<br /> + get_int_option (qxl->options, OPTION_FRAME_BUFFER_SIZE,<br /> "QXL_FRAME_BUFFER_SIZE") << 20L;<br /> + qxl->vram_size =<br /> + get_int_option (qxl->options, OPTION_SURFACE_BUFFER_SIZE,<br /> "QXL_SURFACE_BUFFER_SIZE") << 20L;<br /> + qxl->ram_size =<br /> + get_int_option (qxl->options, OPTION_COMMAND_BUFFER_SIZE,<br /> "QXL_COMMAND_BUFFER_SIZE") << 20L;<br /> #endif<br /> <br /> if (!qxl_map_memory (qxl, scrnIndex))<br /> diff --git a/src/spiceqxl_driver.c b/src/spiceqxl_driver.c<br /> index 990467f..1561562 100644<br /> --- a/src/spiceqxl_driver.c<br /> +++ b/src/spiceqxl_driver.c<br /> @@ -83,20 +83,18 @@ static QXLMode
qxl_modes[] = {<br /> QXL_MODE_EX(1600, 1200),<br /> QXL_MODE_EX(1680, 1050),<br /> QXL_MODE_EX(1920, 1080),<br /> -#if VGA_RAM_SIZE >= (16 * 1024 * 1024)<br /> - /* these modes need more than 8 MB video memory */<br /> QXL_MODE_EX(1920, 1200),<br /> QXL_MODE_EX(1920, 1440),<br /> QXL_MODE_EX(2048, 1536),<br /> QXL_MODE_EX(2560, 1440),<br /> QXL_MODE_EX(2560, 1600),<br /> -#endif<br /> -#if VGA_RAM_SIZE >= (32 * 1024 * 1024)<br /> - /* these modes need more than 16 MB video memory */<br /> + QXL_MODE_EX(3840, 1080),<br /> QXL_MODE_EX(2560, 2048),<br /> QXL_MODE_EX(2800, 2100),<br /> QXL_MODE_EX(3200, 2400),<br /> -#endif<br /> + QXL_MODE_EX(5760, 1080),<br /> + QXL_MODE_EX(7680, 1080),<br /> +<br /> };<br /> <br /> <br /> @@ -106,9 +104,8 @@ void init_qxl_rom(qxl_screen_t* qxl, uint32_t rom_size)<br /> QXLRom *rom = qxl->rom;<br /> struct QXLModes *modes = (struct QXLModes *)(rom + 1);<br />
uint32_t ram_header_size;<br /> - uint32_t surface0_area_size;<br /> uint32_t num_pages;<br /> - uint32_t fb, maxfb = 0;<br /> + uint32_t fb;<br /> int i;<br /> <br /> memset(rom, 0, rom_size);<br /> @@ -127,9 +124,12 @@ void init_qxl_rom(qxl_screen_t* qxl, uint32_t rom_size)<br /> modes->n_modes = (SPICE_ARRAY_SIZE(qxl_modes));<br /> for (i = 0; i < modes->n_modes; i++) {<br /> fb = qxl_modes[i].y_res * qxl_modes[i].stride;<br /> - if (maxfb < fb) {<br /> - maxfb = fb;<br /> + if (fb > qxl->surface0_size)<br /> + {<br /> + modes->n_modes--; i--;<br /> + continue;<br /></blockquote><br />Isn't this going to check the same qxl_modes[i] until i == modes->n_modes? <br /><br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> }<br /> +<br /> modes->modes[i].id =
(i);<br /> modes->modes[i].x_res = (qxl_modes[i].x_res);<br /> modes->modes[i].y_res = (qxl_modes[i].y_res);<br /> @@ -139,21 +139,18 @@ void init_qxl_rom(qxl_screen_t* qxl, uint32_t rom_size)<br /> modes->modes[i].y_mili = (qxl_modes[i].y_mili);<br /> modes->modes[i].orientation = (qxl_modes[i].orientation);<br /> }<br /> - if (maxfb < VGA_RAM_SIZE) // TODO - id != 0? (in original code from<br /> qxl.c)<br /> - maxfb = VGA_RAM_SIZE;<br /> <br /> ram_header_size = ALIGN(sizeof(struct QXLRam), 4096);<br /> - surface0_area_size = ALIGN(maxfb, 4096);<br /> - num_pages = VRAM_SIZE;<br /> + num_pages = qxl->vram_size;<br /> num_pages -= ram_header_size;<br /> - num_pages -= surface0_area_size;<br /> + num_pages -= qxl->surface0_size;<br /> num_pages = num_pages / TARGET_PAGE_SIZE;<br /> <br />
rom->draw_area_offset = (0);<br /> - rom->surface0_area_size = (surface0_area_size);<br /> - rom->pages_offset = (surface0_area_size);<br /> + rom->surface0_area_size = (qxl->surface0_size);<br /> + rom->pages_offset = (rom->surface0_area_size);<br /> rom->num_pages = (num_pages);<br /> - rom->ram_header_offset = (VRAM_SIZE - ram_header_size);<br /> + rom->ram_header_offset = (qxl->vram_size - ram_header_size);<br /> <br /> qxl->shadow_rom = *qxl->rom; // TODO - do we need this?<br /> }<br /> diff --git a/src/spiceqxl_driver.h b/src/spiceqxl_driver.h<br /> index c1a7c48..35d0f42 100644<br /> --- a/src/spiceqxl_driver.h<br /> +++ b/src/spiceqxl_driver.h<br /> @@ -23,10 +23,9 @@<br /> #ifndef SPICEQXL_DRIVER_H<br /> #define SPICEQXL_DRIVER_H 1<br /> <br /> -#define VGA_RAM_SIZE (16 * 1024 * 1024)<br /> -<br /> -#define RAM_SIZE (128L<<20) // must be >VGA_RAM_SIZE<br />
-#define VRAM_SIZE (128L<<20)<br /> +#define DEFAULT_FRAME_BUFFER_SIZE 16<br /> +#define DEFAULT_SURFACE_BUFFER_SIZE 128<br /> +#define DEFAULT_COMMAND_BUFFER_SIZE 128<br /> #define ROM_SIZE (1<<20) // TODO - put correct size<br /> <br /> void init_qxl_rom(qxl_screen_t* qxl, uint32_t rom_size);<br /> --<br /> <a href="http://1.7.10.4">1.7.10.4</a><br /> <br /><hr /><br /> Spice-devel mailing list<br /> Spice-devel@lists.freedesktop.org<br /> <a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br /> <br /></blockquote><hr /><br />Spice-devel mailing list<br />Spice-devel@lists.freedesktop.org<br /><a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br /></pre></blockquote></div><br>
-- <br>
Sent from my Android device with K-9 Mail. Please excuse my brevity.</body></html>