qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <huth@tuxfamily.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Natalia Portillo <claunia@claunia.com>,
	Laurent Vivier <laurent@vivier.eu>,
	Bryce Lanham <blanham@gmail.com>
Subject: Re: [Qemu-devel] [PATCH v1 1/4] m68k: Add NeXTcube framebuffer device emulation
Date: Sat, 30 Jun 2018 21:47:53 +0200	[thread overview]
Message-ID: <20180630214753.37119dd3@thl530.multi.box> (raw)
In-Reply-To: <CAFEAcA8n_qgGgtn055dGkAjHNPbE9d-dRDtfJGMcfhBg_x_Y5g@mail.gmail.com>

Am Sat, 30 Jun 2018 17:12:01 +0100
schrieb Peter Maydell <peter.maydell@linaro.org>:

> On 30 June 2018 at 09:33, Thomas Huth <huth@tuxfamily.org> wrote:
> > The NeXTcube uses a linear framebuffer with 4 greyscale colors and
> > a fixed resolution of 1120 * 832.
> > This code has been taken from Bryce Lanham's GSoC 2011 NeXT branch
> > at
> >
> >  https://github.com/blanham/qemu-NeXT/blob/next-cube/hw/next-fb.c
> >
> > and altered to fit the latest interface of the current QEMU (e.g.
> > the device has been "qdev"-ified etc.).
> >
> > Signed-off-by: Thomas Huth <huth@tuxfamily.org>  
> 
> > +static void nextfb_realize(DeviceState *dev, Error **errp)
> > +{
> > +    NeXTFbState *s = NEXTFB(dev);
> > +
> > +    memory_region_allocate_system_memory(&s->fb_mr, NULL,
> > "next.video",
> > +                                         0x1CB100);  
> 
> memory_region_allocate_system_memory() is for allocating
> a machine model's main memory, not for things like video
> framebuffer RAM. (See the doc comment in memory.h.)

That comment recommends memory_region_allocate_aux_memory(), but
that function does not exist (anymore)?

> > +    memory_region_add_subregion(get_system_memory(), 0xB000000,
> > &s->fb_mr);  
> 
> Devices shouldn't directly add memory regions into
> system memory. Instead they should expose sysbus
> memory regions which the board model then maps into
> the right place.

Ok, ... so just to make sure that I've got you right: The device
should call memory_region_init_ram() in it's realize function and the
board code should then call sysbus_mmio_map() with that region, right?

 Thomas

  reply	other threads:[~2018-06-30 19:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-30  8:33 [Qemu-devel] [PATCH v1 0/4] m68k: Add basic support for the NeXTcube machine Thomas Huth
2018-06-30  8:33 ` [Qemu-devel] [PATCH v1 1/4] m68k: Add NeXTcube framebuffer device emulation Thomas Huth
2018-06-30 16:00   ` Richard Henderson
2018-06-30 16:12   ` Peter Maydell
2018-06-30 19:47     ` Thomas Huth [this message]
2018-06-30 20:06       ` Peter Maydell
2018-06-30  8:33 ` [Qemu-devel] [PATCH v1 2/4] m68k: Add NeXTcube keyboard device Thomas Huth
2018-06-30 16:18   ` Peter Maydell
2018-06-30  8:33 ` [Qemu-devel] [PATCH v1 4/4] m68k: Add an entry for the NeXTcube machine to the MAINTAINERS file Thomas Huth
2018-06-30  9:42 ` [Qemu-devel] [PATCH v1 0/4] m68k: Add basic support for the NeXTcube machine Mark Cave-Ayland
2018-06-30 13:14   ` Thomas Huth
2018-06-30 13:17     ` Peter Maydell
2018-06-30 13:34       ` Thomas Huth
2018-06-30 17:07         ` Bryce Lanham
2018-06-30 20:09           ` Thomas Huth
2018-07-03 20:58           ` Natalia Portillo

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=20180630214753.37119dd3@thl530.multi.box \
    --to=huth@tuxfamily.org \
    --cc=blanham@gmail.com \
    --cc=claunia@claunia.com \
    --cc=laurent@vivier.eu \
    --cc=peter.maydell@linaro.org \
    --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).