From: Peter Maydell <peter.maydell@linaro.org>
To: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Cc: "qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
Patch Tracking <patches@linaro.org>
Subject: Re: [Qemu-devel] [PATCH 3/8] hw/display/pxa2xx_lcd: Fix 16bpp+alpha and 18bpp+alpha palette formats
Date: Tue, 13 May 2014 16:23:01 +0100 [thread overview]
Message-ID: <CAFEAcA8uYrS7i+xscZgUvuFajiFu0ymSpdP+HEmicifCEuXvxg@mail.gmail.com> (raw)
In-Reply-To: <CAEgOgz5RTfWEeAS2CA2KhX=KX2by3dv4XoZwFKQwPeGFC1zQMw@mail.gmail.com>
On 10 May 2014 00:35, Peter Crosthwaite <peter.crosthwaite@xilinx.com> wrote:
> On Fri, May 9, 2014 at 4:46 AM, Peter Maydell <peter.maydell@linaro.org> wrote:
>> The pxa2xx palette entry "16bpp plus transparency" format is
>> xxxxxxxTRRRRR000GGGGGG00BBBBB000, and "18bpp plus transparency" is
>> xxxxxxxTRRRRRR00GGGGGG00BBBBBB00.
>>
>> Correct errors in the code for reading these and converting
>> them to the internal format. In particular, the buggy code
>> was attempting to mask out bit 24 of a uint16_t, which
>> Coverity spotted as an error.
>>
>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>> ---
>> hw/display/pxa2xx_lcd.c | 14 +++++++-------
>> 1 file changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/hw/display/pxa2xx_lcd.c b/hw/display/pxa2xx_lcd.c
>> index 09cdf17..fce013d 100644
>> --- a/hw/display/pxa2xx_lcd.c
>> +++ b/hw/display/pxa2xx_lcd.c
>> @@ -620,13 +620,13 @@ static void pxa2xx_palette_parse(PXA2xxLCDState *s, int ch, int bpp)
>> src += 2;
>> break;
>> case 1: /* 16 bpp plus transparency */
>> - alpha = *(uint16_t *) src & (1 << 24);
>> + alpha = *(uint32_t *) src & (1 << 24);
>> if (s->control[0] & LCCR0_CMS)
>> - r = g = b = *(uint16_t *) src & 0xff;
>> + r = g = b = *(uint32_t *) src & 0xff;
>> else {
>> - r = (*(uint16_t *) src & 0xf800) >> 8;
>> - g = (*(uint16_t *) src & 0x07e0) >> 3;
>> - b = (*(uint16_t *) src & 0x001f) << 3;
>> + r = (*(uint32_t *) src & 0x7c0000) >> 15;
>
> 16BPP format (pasted from above with byte spacing)
> xxxxxxxT RRRRR000 GGGGGG00 BBBBB000
>
> So shouldn't r be 0xf80000 >> 16?
Yep, you're right. My first attempt at this I read the wrong
diagram from the manual (the framebuffer pixel formats are
different from the palette formats) and failed to spot I
hadn't corrected the code completely.
Since this is the only patch in this set that needs a
respin, and they're all independent fixes, I'll put the
other 7 into target-arm.next and just resend this.
thanks
-- PMM
next prev parent reply other threads:[~2014-05-13 15:23 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-08 18:46 [Qemu-devel] [PATCH 0/8] misc fixes for coverity warnings in ARM devices Peter Maydell
2014-05-08 18:46 ` [Qemu-devel] [PATCH 1/8] hw/intc/allwinner-a10-pic: Add missing 'break' Peter Maydell
2014-05-09 22:45 ` Peter Crosthwaite
2014-05-08 18:46 ` [Qemu-devel] [PATCH 2/8] hw/net/cadence_gem: Remove dead code Peter Maydell
2014-05-09 22:50 ` Peter Crosthwaite
2014-05-08 18:46 ` [Qemu-devel] [PATCH 3/8] hw/display/pxa2xx_lcd: Fix 16bpp+alpha and 18bpp+alpha palette formats Peter Maydell
2014-05-09 23:35 ` Peter Crosthwaite
2014-05-13 15:23 ` Peter Maydell [this message]
2014-05-08 18:46 ` [Qemu-devel] [PATCH 4/8] hw/arm/omap1: Avoid unintended sign extension writing omap_rtc YEARS_REG Peter Maydell
2014-05-09 23:45 ` Peter Crosthwaite
2014-05-08 18:46 ` [Qemu-devel] [PATCH 5/8] hw/dma/omap_dma: Add (uint32_t) casts when shifting uint16_t by 16 Peter Maydell
2014-05-09 23:47 ` Peter Crosthwaite
2014-05-08 18:46 ` [Qemu-devel] [PATCH 6/8] hw/timer/exynos4210_mct: Avoid overflow in exynos4210_ltick_recalc_count Peter Maydell
2014-05-09 23:49 ` Peter Crosthwaite
2014-05-08 18:46 ` [Qemu-devel] [PATCH 7/8] hw/arm/stellaris: Correct handling of GPTM TAR register Peter Maydell
2014-05-10 12:33 ` Peter Crosthwaite
2014-05-10 13:48 ` Peter Maydell
2014-05-08 18:46 ` [Qemu-devel] [PATCH 8/8] hw/arm/omap_gpmc: Avoid buffer overrun filling prefetch FIFO Peter Maydell
2014-05-10 12:55 ` Peter Crosthwaite
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=CAFEAcA8uYrS7i+xscZgUvuFajiFu0ymSpdP+HEmicifCEuXvxg@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=patches@linaro.org \
--cc=peter.crosthwaite@xilinx.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).