From: Pooja Dhannawat <dhannawatpooja1@gmail.com>
To: QEMU Developers <qemu-devel@nongnu.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v4] blizzard: Remove support for DEPTH != 32
Date: Tue, 5 Apr 2016 12:24:19 +0530 [thread overview]
Message-ID: <CAPAwAwgTPfVHw_oRJaDp=6h6yYEhF7f86St0xbYr_PqdqQ+2fw@mail.gmail.com> (raw)
In-Reply-To: <1458971873-2768-1-git-send-email-dhannawatpooja1@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 4480 bytes --]
CCing Eric Blake and Gerd Hoffmann.
On Sat, Mar 26, 2016 at 11:27 AM, Pooja Dhannawat <dhannawatpooja1@gmail.com
> wrote:
> Removing support for DEPTH != 32 from blizzard template header
> and file that includes it, as macro DEPTH == 32 only used.
>
> Reviewed-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Pooja Dhannawat <dhannawatpooja1@gmail.com>
> ---
> hw/display/blizzard.c | 41
> ++++-------------------------------------
> hw/display/blizzard_template.h | 30 +-----------------------------
> 2 files changed, 5 insertions(+), 66 deletions(-)
>
> diff --git a/hw/display/blizzard.c b/hw/display/blizzard.c
> index c231960..5684e49 100644
> --- a/hw/display/blizzard.c
> +++ b/hw/display/blizzard.c
> @@ -925,14 +925,6 @@ static void blizzard_update_display(void *opaque)
> s->my[1] = 0;
> }
>
> -#define DEPTH 8
> -#include "blizzard_template.h"
> -#define DEPTH 15
> -#include "blizzard_template.h"
> -#define DEPTH 16
> -#include "blizzard_template.h"
> -#define DEPTH 24
> -#include "blizzard_template.h"
> #define DEPTH 32
> #include "blizzard_template.h"
>
> @@ -951,35 +943,10 @@ void *s1d13745_init(qemu_irq gpio_int)
> s->con = graphic_console_init(NULL, 0, &blizzard_ops, s);
> surface = qemu_console_surface(s->con);
>
> - switch (surface_bits_per_pixel(surface)) {
> - case 0:
> - s->line_fn_tab[0] = s->line_fn_tab[1] =
> - g_malloc0(sizeof(blizzard_fn_t) * 0x10);
> - break;
> - case 8:
> - s->line_fn_tab[0] = blizzard_draw_fn_8;
> - s->line_fn_tab[1] = blizzard_draw_fn_r_8;
> - break;
> - case 15:
> - s->line_fn_tab[0] = blizzard_draw_fn_15;
> - s->line_fn_tab[1] = blizzard_draw_fn_r_15;
> - break;
> - case 16:
> - s->line_fn_tab[0] = blizzard_draw_fn_16;
> - s->line_fn_tab[1] = blizzard_draw_fn_r_16;
> - break;
> - case 24:
> - s->line_fn_tab[0] = blizzard_draw_fn_24;
> - s->line_fn_tab[1] = blizzard_draw_fn_r_24;
> - break;
> - case 32:
> - s->line_fn_tab[0] = blizzard_draw_fn_32;
> - s->line_fn_tab[1] = blizzard_draw_fn_r_32;
> - break;
> - default:
> - fprintf(stderr, "%s: Bad color depth\n", __FUNCTION__);
> - exit(1);
> - }
> + assert(surface_bits_per_pixel(surface) == 32)
> +
> + s->line_fn_tab[0] = blizzard_draw_fn_32;
> + s->line_fn_tab[1] = blizzard_draw_fn_r_32;
>
> blizzard_reset(s);
>
> diff --git a/hw/display/blizzard_template.h
> b/hw/display/blizzard_template.h
> index b7ef27c..bc38d7a 100644
> --- a/hw/display/blizzard_template.h
> +++ b/hw/display/blizzard_template.h
> @@ -19,31 +19,7 @@
> */
>
> #define SKIP_PIXEL(to) (to += deststep)
> -#if DEPTH == 8
> -# define PIXEL_TYPE uint8_t
> -# define COPY_PIXEL(to, from) do { *to = from; SKIP_PIXEL(to); } while
> (0)
> -# define COPY_PIXEL1(to, from) (*to++ = from)
> -#elif DEPTH == 15 || DEPTH == 16
> -# define PIXEL_TYPE uint16_t
> -# define COPY_PIXEL(to, from) do { *to = from; SKIP_PIXEL(to); } while
> (0)
> -# define COPY_PIXEL1(to, from) (*to++ = from)
> -#elif DEPTH == 24
> -# define PIXEL_TYPE uint8_t
> -# define COPY_PIXEL(to, from) \
> - do { \
> - to[0] = from; \
> - to[1] = (from) >> 8; \
> - to[2] = (from) >> 16; \
> - SKIP_PIXEL(to); \
> - } while (0)
> -
> -# define COPY_PIXEL1(to, from) \
> - do { \
> - *to++ = from; \
> - *to++ = (from) >> 8; \
> - *to++ = (from) >> 16; \
> - } while (0)
> -#elif DEPTH == 32
> +#if DEPTH == 32
> # define PIXEL_TYPE uint32_t
> # define COPY_PIXEL(to, from) do { *to = from; SKIP_PIXEL(to); } while
> (0)
> # define COPY_PIXEL1(to, from) (*to++ = from)
> @@ -58,9 +34,6 @@
> static void glue(blizzard_draw_line16_, DEPTH)(PIXEL_TYPE *dest,
> const uint16_t *src, unsigned int width)
> {
> -#if !defined(SWAP_WORDS) && DEPTH == 16
> - memcpy(dest, src, width);
> -#else
> uint16_t data;
> unsigned int r, g, b;
> const uint16_t *end = (const void *) src + width;
> @@ -74,7 +47,6 @@ static void glue(blizzard_draw_line16_,
> DEPTH)(PIXEL_TYPE *dest,
> data >>= 5;
> COPY_PIXEL1(dest, glue(rgb_to_pixel, DEPTH)(r, g, b));
> }
> -#endif
> }
>
> static void glue(blizzard_draw_line24mode1_, DEPTH)(PIXEL_TYPE *dest,
> --
> 2.5.0
>
>
[-- Attachment #2: Type: text/html, Size: 5748 bytes --]
next prev parent reply other threads:[~2016-04-05 6:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-26 5:57 [Qemu-devel] [PATCH v4] blizzard: Remove support for DEPTH != 32 Pooja Dhannawat
2016-04-05 6:54 ` Pooja Dhannawat [this message]
2016-05-04 14:13 ` Peter Maydell
-- strict thread matches above, loose matches on Subject: below --
2016-03-24 18:18 Pooja Dhannawat
2016-03-24 19:03 ` Eric Blake
2016-03-25 3:09 ` Fam Zheng
2016-03-25 6:06 ` Pooja Dhannawat
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='CAPAwAwgTPfVHw_oRJaDp=6h6yYEhF7f86St0xbYr_PqdqQ+2fw@mail.gmail.com' \
--to=dhannawatpooja1@gmail.com \
--cc=kraxel@redhat.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).