qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: BALATON Zoltan <balaton@eik.bme.hu>
Cc: Blue Swirl <blauwirbel@gmail.com>, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 2/4 v5] vmware_vga: Remove duplicated info from local state
Date: Sun, 04 Nov 2012 07:39:26 +0100	[thread overview]
Message-ID: <50960D9E.6070308@web.de> (raw)
In-Reply-To: <20121103105850.B64D5496@mono.eik.bme.hu>

[-- Attachment #1: Type: text/plain, Size: 2910 bytes --]

On 2012-11-03 11:58, BALATON Zoltan wrote:
> Removed info from vmsvga_state that is available from elsewhere and
> thus was duplicated here unnecessarily.
> 
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
> ---
>  console.h       |   20 +++++++
>  hw/vmware_vga.c |  159 +++++++++++++++++++++++--------------------------------
>  2 files changed, 85 insertions(+), 94 deletions(-)
> 
>  v5: rebased again
> 
> diff --git a/console.h b/console.h
> index 33ad69b..df33e46 100644
> --- a/console.h
> +++ b/console.h
> @@ -377,6 +377,26 @@ static inline pixman_format_code_t ds_get_format(DisplayState *ds)
>      return ds->surface->format;
>  }
>  
> +static inline int ds_get_depth(DisplayState *ds)
> +{
> +    return ds->surface->pf.depth;

This returns the current depth...

> +}
> +
> +static inline int ds_get_rmask(DisplayState *ds)
> +{
> +    return ds->surface->pf.rmask;
> +}
> +
> +static inline int ds_get_gmask(DisplayState *ds)
> +{
> +    return ds->surface->pf.gmask;
> +}
> +
> +static inline int ds_get_bmask(DisplayState *ds)
> +{
> +    return ds->surface->pf.bmask;
> +}
> +
>  #ifdef CONFIG_CURSES
>  #include <curses.h>
>  typedef chtype console_ch_t;
> diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
> index bf14e78..240443b 100644
> --- a/hw/vmware_vga.c
> +++ b/hw/vmware_vga.c

...

> @@ -730,23 +726,25 @@ static uint32_t vmsvga_value_read(void *opaque, uint32_t address)
>          return SVGA_MAX_HEIGHT;
>  
>      case SVGA_REG_DEPTH:
> -        return s->depth;
> +        return ds_get_depth(s->vga.ds);

...while we used to return a cached value here

>  
>      case SVGA_REG_BITS_PER_PIXEL:
> -        return (s->depth + 7) & ~7;
> +        return ds_get_bits_per_pixel(s->vga.ds);
>  
>      case SVGA_REG_PSEUDOCOLOR:
>          return 0x0;
>  
>      case SVGA_REG_RED_MASK:
> -        return s->wred;
> +        return ds_get_rmask(s->vga.ds);
> +
>      case SVGA_REG_GREEN_MASK:
> -        return s->wgreen;
> +        return ds_get_gmask(s->vga.ds);
> +
>      case SVGA_REG_BLUE_MASK:
> -        return s->wblue;
> +        return ds_get_bmask(s->vga.ds);
>  
>      case SVGA_REG_BYTES_PER_LINE:
> -        return ((s->depth + 7) >> 3) * s->new_width;
> +        return ds_get_bytes_per_pixel(s->vga.ds) * s->new_width;
>  
>      case SVGA_REG_FB_START: {
>          struct pci_vmsvga_state_s *pci_vmsvga

...

> @@ -1125,40 +1130,9 @@ static void vmsvga_init(struct vmsvga_state_s *s,
>      vga_common_init(&s->vga);
>      vga_init(&s->vga, address_space, io, true);
>      vmstate_register(NULL, 0, &vmstate_vga_common, &s->vga);
> -
> -    s->depth = ds_get_bits_per_pixel(s->vga.ds);

...sampled once during init.

I cannot comment on why it was done like this, just that this patch
breaks the Linux vmware X driver. Please fix or revert.

Jan



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

  reply	other threads:[~2012-11-04  6:39 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-03  9:22 [Qemu-devel] [PATCH 0/3] vmware_vga: Cleanup and allow simple drivers to work without the fifo BALATON Zoltan
2012-10-03  9:30 ` [Qemu-devel] [PATCH 1/3 v2] vmware_vga: Cleanup and remove duplicated info from local state BALATON Zoltan
2012-10-03  9:42   ` Paolo Bonzini
2012-10-03  9:30 ` [Qemu-devel] [PATCH 2/3 v2] vmware_vga: Return a value for FB_SIZE before the device is enabled BALATON Zoltan
2012-10-03  9:43   ` Paolo Bonzini
2012-10-03  9:31 ` [Qemu-devel] [PATCH 3/3 v2] vmware_vga: Allow simple drivers to work without using the fifo BALATON Zoltan
2012-10-03  9:46   ` Paolo Bonzini
2012-10-06 18:33 ` [Qemu-devel] [PATCH 1/4 v3] vmware_vga: Coding style cleanup BALATON Zoltan
2012-10-18 19:07   ` BALATON Zoltan
2012-10-29 10:38     ` BALATON Zoltan
2012-10-30 18:50       ` Blue Swirl
2012-10-31  1:08         ` [Qemu-devel] [PATCH 1/4 v4] " BALATON Zoltan
2012-11-02  1:20           ` [Qemu-devel] [PATCH 1/4 v5] " BALATON Zoltan
2012-11-02  1:20             ` [Qemu-devel] [PATCH 2/4 v5] vmware_vga: Remove duplicated info from local state BALATON Zoltan
2012-11-02  1:21               ` [Qemu-devel] [PATCH 3/4 v5] vmware_vga: Return a value for FB_SIZE before the device is enabled BALATON Zoltan
2012-11-02  1:21                 ` [Qemu-devel] [PATCH 4/4 v5] vmware_vga: Allow simple drivers to work without using the fifo BALATON Zoltan
2012-11-03  9:51             ` [Qemu-devel] [PATCH 1/4 v5] vmware_vga: Coding style cleanup Blue Swirl
2012-11-03 12:51               ` BALATON Zoltan
2012-11-03 10:58             ` BALATON Zoltan
2012-11-03 10:58             ` [Qemu-devel] [PATCH 2/4 v5] vmware_vga: Remove duplicated info from local state BALATON Zoltan
2012-11-04  6:39               ` Jan Kiszka [this message]
2012-11-04 10:20                 ` BALATON Zoltan
2012-11-04 17:58                 ` BALATON Zoltan
2012-11-03 10:58             ` [Qemu-devel] [PATCH 3/4 v5] vmware_vga: Return a value for FB_SIZE before the device is enabled BALATON Zoltan
2012-11-03 10:59             ` [Qemu-devel] [PATCH 4/4 v5] vmware_vga: Allow simple drivers to work without using the fifo BALATON Zoltan
2012-11-03 11:47             ` [Qemu-devel] [PATCH 2/4 v5] vmware_vga: Remove duplicated info from local state BALATON Zoltan
2012-11-03 11:47             ` [Qemu-devel] [PATCH 4/4 v5] vmware_vga: Allow simple drivers to work without using the fifo BALATON Zoltan
2012-11-03 11:47             ` [Qemu-devel] [PATCH 3/4 v5] vmware_vga: Return a value for FB_SIZE before the device is enabled BALATON Zoltan
2012-11-03 11:47             ` [Qemu-devel] [PATCH 1/4 v5] vmware_vga: Coding style cleanup BALATON Zoltan
2012-11-03 15:20               ` Blue Swirl
2012-11-03 11:47             ` [Qemu-devel] [PATCH 4/4 v5] vmware_vga: Allow simple drivers to work without using the fifo BALATON Zoltan
2012-11-03 11:47             ` [Qemu-devel] [PATCH 3/4 v5] vmware_vga: Return a value for FB_SIZE before the device is enabled BALATON Zoltan
2012-11-03 11:47             ` [Qemu-devel] [PATCH 1/4 v5] vmware_vga: Coding style cleanup BALATON Zoltan
2012-11-03 11:47             ` [Qemu-devel] [PATCH 2/4 v5] vmware_vga: Remove duplicated info from local state BALATON Zoltan
2012-10-31  1:08         ` [Qemu-devel] [PATCH 2/4 v4] " BALATON Zoltan
2012-10-31  1:09         ` [Qemu-devel] [PATCH 3/4 v4] vmware_vga: Return a value for FB_SIZE before the device is enabled BALATON Zoltan
2012-10-31  1:10         ` [Qemu-devel] [PATCH 4/4 v4] vmware_vga: Allow simple drivers to work without using the fifo BALATON Zoltan
2012-10-31  1:12         ` [Qemu-devel] [PATCH 1/4 v3] vmware_vga: Coding style cleanup BALATON Zoltan
2012-10-06 18:34 ` [Qemu-devel] [PATCH 2/4 v3] vmware_vga: Remove duplicated info from local state BALATON Zoltan
2012-10-06 18:35 ` [Qemu-devel] [PATCH 3/4 v3] vmware_vga: Return a value for FB_SIZE before the device is enabled BALATON Zoltan
2012-10-06 18:35 ` [Qemu-devel] [PATCH 4/4 v3] vmware_vga: Allow simple drivers to work without using the fifo BALATON Zoltan

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=50960D9E.6070308@web.de \
    --to=jan.kiszka@web.de \
    --cc=balaton@eik.bme.hu \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).