All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: qemu-devel@nongnu.org,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Qemu-devel] [PATCH 1 of 6] [UPDATE] vnc dynamic resolution
Date: Wed, 10 Sep 2008 10:09:53 -0500	[thread overview]
Message-ID: <48C7E341.7060604@codemonkey.ws> (raw)
In-Reply-To: <48C54E82.1090104@eu.citrix.com>

Stefano Stabellini wrote:
> This patch implements dynamic colour depth changes in vnc.c:
> this way the vnc server can change its own internal colour depth at run
> time to follow any guest resolution change.
>   

When testing this patch, gvncviewer hangs when attempting to connect.  
It's waiting to receive the ServerPixelFormat and it doesn't appear to 
receive it.

> @@ -1318,7 +1440,9 @@ static int protocol_client_init(VncState *vs, uint8_t *data, size_t len)
>      vnc_write_u16(vs, vs->ds->height);
>  
>      vnc_write_u8(vs, vs->depth * 8); /* bits-per-pixel */
> -    vnc_write_u8(vs, vs->depth * 8); /* depth */
> +    if (vs->depth == 4) vnc_write_u8(vs, 24); /* depth */
> +    else vnc_write_u8(vs, vs->depth * 8); /* depth */
>   

Why unconditionally change to a depth of 24 instead of 32?  There's no 
savings from a protocol perspective.

Regards,

Anthony Liguori

>  #ifdef WORDS_BIGENDIAN
>      vnc_write_u8(vs, 1);             /* big-endian-flag */
>  #else
> @@ -2008,7 +2132,6 @@ void vnc_display_init(DisplayState *ds)
>  
>      vs->lsock = -1;
>      vs->csock = -1;
> -    vs->depth = 4;
>      vs->last_x = -1;
>      vs->last_y = -1;
>  
> diff --git a/vnchextile.h b/vnchextile.h
> index 09c1b27..eb05feb 100644
> --- a/vnchextile.h
> +++ b/vnchextile.h
> @@ -2,29 +2,29 @@
>  #define CONCAT(a, b) CONCAT_I(a, b)
>  #define pixel_t CONCAT(uint, CONCAT(BPP, _t))
>  #ifdef GENERIC
> -#define NAME generic
> +#define NAME CONCAT(generic_, BPP)
>  #else
>  #define NAME BPP
>  #endif
>  
>  static void CONCAT(send_hextile_tile_, NAME)(VncState *vs,
>                                               int x, int y, int w, int h,
> -                                             uint32_t *last_bg32,
> -                                             uint32_t *last_fg32,
> +                                             void *last_bg_,
> +                                             void *last_fg_,
>                                               int *has_bg, int *has_fg)
>  {
>      uint8_t *row = (vs->ds->data + y * vs->ds->linesize + x * vs->depth);
>      pixel_t *irow = (pixel_t *)row;
>      int j, i;
> -    pixel_t *last_bg = (pixel_t *)last_bg32;
> -    pixel_t *last_fg = (pixel_t *)last_fg32;
> +    pixel_t *last_bg = (pixel_t *)last_bg_;
> +    pixel_t *last_fg = (pixel_t *)last_fg_;
>      pixel_t bg = 0;
>      pixel_t fg = 0;
>      int n_colors = 0;
>      int bg_count = 0;
>      int fg_count = 0;
>      int flags = 0;
> -    uint8_t data[(sizeof(pixel_t) + 2) * 16 * 16];
> +    uint8_t data[(vs->pix_bpp + 2) * 16 * 16];
>      int n_data = 0;
>      int n_subtiles = 0;
>  
>
>
>   

  reply	other threads:[~2008-09-10 15:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-08 16:10 [Qemu-devel] [PATCH 1 of 6] [UPDATE] vnc dynamic resolution Stefano Stabellini
2008-09-10 15:09 ` Anthony Liguori [this message]
2008-09-11 10:47   ` Stefano Stabellini
2008-09-11 10:58   ` Stefano Stabellini
  -- strict thread matches above, loose matches on Subject: below --
2008-09-12 11:26 Stefano Stabellini
2008-09-15 16:04 ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48C7E341.7060604@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.