qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Incorrect hw/omap_dss.c:chip[] index for RFBI_READ and


From: andrzej zaborowski
Subject: Re: [Qemu-devel] Incorrect hw/omap_dss.c:chip[] index for RFBI_READ and RFBI_STATUS?
Date: Fri, 6 Jan 2012 20:37:09 +0100

Hi,

On 6 January 2012 17:55, Stefan Hajnoczi <address@hidden> wrote:
> Is the following code correct in hw/omap_dss.c:
>
> case 0x58:  /* RFBI_READ */
>    if ((s->rfbi.control & (1 << 2)) && s->rfbi.chip[0])
>        s->rfbi.rxbuf = s->rfbi.chip[0]->read(s->rfbi.chip[0]->opaque, 1);
>    else if ((s->rfbi.control & (1 << 3)) && s->rfbi.chip[1])
>        s->rfbi.rxbuf = s->rfbi.chip[0]->read(s->rfbi.chip[0]->opaque, 1);
>    if (!-- s->rfbi.pixels)
>        omap_rfbi_transfer_stop(s);
>    break;
>
> case 0x5c:  /* RFBI_STATUS */
>    if ((s->rfbi.control & (1 << 2)) && s->rfbi.chip[0])
>        s->rfbi.rxbuf = s->rfbi.chip[0]->read(s->rfbi.chip[0]->opaque, 0);
>    else if ((s->rfbi.control & (1 << 3)) && s->rfbi.chip[1])
>        s->rfbi.rxbuf = s->rfbi.chip[0]->read(s->rfbi.chip[0]->opaque, 0);
>    if (!-- s->rfbi.pixels)
>        omap_rfbi_transfer_stop(s);
>    break;
>
> It checks chip[1] in the "else if" statement.  But notice it actually
> operates on chip[0].
>
> Is this intentional or should it use chip[1]?

Right, it should use chip[1], it's a bug.  If a machine only had a
rfbi chip attached at 1, it might even cause a segfault, but the N900
uses only rfbi 0.

Cheers



reply via email to

[Prev in Thread] Current Thread [Next in Thread]