From: Peter Maydell <peter.maydell@linaro.org>
To: iwona260909@gmail.com
Cc: QEMU Developers <qemu-devel@nongnu.org>,
Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] Dead code removal: removing code for unsupported DEPTH.
Date: Thu, 16 Mar 2017 12:07:25 +0000 [thread overview]
Message-ID: <CAFEAcA8ZBAAqYNbh_3J69W5SMXRsbW4S367Xe8ceF1C0M-RNnA@mail.gmail.com> (raw)
In-Reply-To: <20170316120110.11677-2-iwona260909@gmail.com>
On 16 March 2017 at 12:01, <iwona260909@gmail.com> wrote:
> From: Iwona Kotlarska <iwona260909@gmail.com>
>
> Signed-off-by: Iwona Kotlarska <iwona260909@gmail.com>
Thanks -- cc'ing Gerd who's just done some cirrus patches and
is probably best placed to review this.
PS: if you put "cirrus_vga:" in your patch subject then it
helps people to know what part of QEMU your patch is affecting.
-- PMM
> ---
> hw/display/cirrus_vga.c | 3 ---
> hw/display/cirrus_vga_rop.h | 9 ---------
> hw/display/cirrus_vga_rop2.h | 46 ++------------------------------------------
> 3 files changed, 2 insertions(+), 56 deletions(-)
>
> diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
> index b9e7cb1df1..efa9609ccd 100644
> --- a/hw/display/cirrus_vga.c
> +++ b/hw/display/cirrus_vga.c
> @@ -478,9 +478,6 @@ static const cirrus_bitblt_rop_t cirrus_bkwd_transp_rop[16][2] = {
> };
>
> #define ROP2(name) {\
> - name ## _8,\
> - name ## _16,\
> - name ## _24,\
> name ## _32,\
> }
>
> diff --git a/hw/display/cirrus_vga_rop.h b/hw/display/cirrus_vga_rop.h
> index 0925a009fe..f175c808cc 100644
> --- a/hw/display/cirrus_vga_rop.h
> +++ b/hw/display/cirrus_vga_rop.h
> @@ -189,15 +189,6 @@ glue(glue(cirrus_bitblt_rop_bkwd_transp_, ROP_NAME),_16)(CirrusVGAState *s,
> }
> }
>
> -#define DEPTH 8
> -#include "cirrus_vga_rop2.h"
> -
> -#define DEPTH 16
> -#include "cirrus_vga_rop2.h"
> -
> -#define DEPTH 24
> -#include "cirrus_vga_rop2.h"
> -
> #define DEPTH 32
> #include "cirrus_vga_rop2.h"
>
> diff --git a/hw/display/cirrus_vga_rop2.h b/hw/display/cirrus_vga_rop2.h
> index d28bcc6f25..adf0f30a94 100644
> --- a/hw/display/cirrus_vga_rop2.h
> +++ b/hw/display/cirrus_vga_rop2.h
> @@ -22,15 +22,8 @@
> * THE SOFTWARE.
> */
>
> -#if DEPTH == 8
> -#define PUTPIXEL() ROP_OP(&d[0], col)
> -#elif DEPTH == 16
> -#define PUTPIXEL() ROP_OP_16((uint16_t *)&d[0], col)
> -#elif DEPTH == 24
> -#define PUTPIXEL() ROP_OP(&d[0], col); \
> - ROP_OP(&d[1], (col >> 8)); \
> - ROP_OP(&d[2], (col >> 16))
> -#elif DEPTH == 32
> +
> +#if DEPTH == 32
> #define PUTPIXEL() ROP_OP_32(((uint32_t *)&d[0]), col)
> #else
> #error unsupported DEPTH
> @@ -47,41 +40,16 @@ glue(glue(glue(cirrus_patternfill_, ROP_NAME), _),DEPTH)
> int x, y, pattern_y, pattern_pitch, pattern_x;
> unsigned int col;
> const uint8_t *src1;
> -#if DEPTH == 24
> - int skipleft = s->vga.gr[0x2f] & 0x1f;
> -#else
> int skipleft = (s->vga.gr[0x2f] & 0x07) * (DEPTH / 8);
> -#endif
> -
> -#if DEPTH == 8
> - pattern_pitch = 8;
> -#elif DEPTH == 16
> - pattern_pitch = 16;
> -#else
> pattern_pitch = 32;
> -#endif
> pattern_y = s->cirrus_blt_srcaddr & 7;
> for(y = 0; y < bltheight; y++) {
> pattern_x = skipleft;
> d = dst + skipleft;
> src1 = src + pattern_y * pattern_pitch;
> for (x = skipleft; x < bltwidth; x += (DEPTH / 8)) {
> -#if DEPTH == 8
> - col = src1[pattern_x];
> - pattern_x = (pattern_x + 1) & 7;
> -#elif DEPTH == 16
> - col = ((uint16_t *)(src1 + pattern_x))[0];
> - pattern_x = (pattern_x + 2) & 15;
> -#elif DEPTH == 24
> - {
> - const uint8_t *src2 = src1 + pattern_x * 3;
> - col = src2[0] | (src2[1] << 8) | (src2[2] << 16);
> - pattern_x = (pattern_x + 1) & 7;
> - }
> -#else
> col = ((uint32_t *)(src1 + pattern_x))[0];
> pattern_x = (pattern_x + 4) & 31;
> -#endif
> PUTPIXEL();
> d += (DEPTH / 8);
> }
> @@ -104,13 +72,8 @@ glue(glue(glue(cirrus_colorexpand_transp_, ROP_NAME), _),DEPTH)
> unsigned int col;
> unsigned bitmask;
> unsigned index;
> -#if DEPTH == 24
> - int dstskipleft = s->vga.gr[0x2f] & 0x1f;
> - int srcskipleft = dstskipleft / 3;
> -#else
> int srcskipleft = s->vga.gr[0x2f] & 0x07;
> int dstskipleft = srcskipleft * (DEPTH / 8);
> -#endif
>
> if (s->cirrus_blt_modeext & CIRRUS_BLTMODEEXT_COLOREXPINV) {
> bits_xor = 0xff;
> @@ -187,13 +150,8 @@ glue(glue(glue(cirrus_colorexpand_pattern_transp_, ROP_NAME), _),DEPTH)
> int x, y, bitpos, pattern_y;
> unsigned int bits, bits_xor;
> unsigned int col;
> -#if DEPTH == 24
> - int dstskipleft = s->vga.gr[0x2f] & 0x1f;
> - int srcskipleft = dstskipleft / 3;
> -#else
> int srcskipleft = s->vga.gr[0x2f] & 0x07;
> int dstskipleft = srcskipleft * (DEPTH / 8);
> -#endif
>
> if (s->cirrus_blt_modeext & CIRRUS_BLTMODEEXT_COLOREXPINV) {
> bits_xor = 0xff;
> --
> 2.12.0
>
>
next prev parent reply other threads:[~2017-03-16 12:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-16 12:01 [Qemu-devel] [PATCH] Dead code removal: removing code for unsupported DEPTH iwona260909
2017-03-16 12:01 ` iwona260909
2017-03-16 12:07 ` Peter Maydell [this message]
2017-03-16 14:12 ` Gerd Hoffmann
2017-03-16 14:26 ` Paolo Bonzini
2017-03-24 13:36 ` Stefan Hajnoczi
2017-03-24 13:40 ` Peter Maydell
2017-03-27 6:23 ` Gerd Hoffmann
2017-03-29 14:56 ` Iwona Kotlarska
2017-03-27 6:20 ` Gerd Hoffmann
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=CAFEAcA8ZBAAqYNbh_3J69W5SMXRsbW4S367Xe8ceF1C0M-RNnA@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=iwona260909@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).