From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: Paul Brook <paul@codesourcery.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 0 of 7] [UPDATE] DisplayState interface change
Date: Thu, 11 Dec 2008 15:22:12 +0000 [thread overview]
Message-ID: <49413024.5020106@eu.citrix.com> (raw)
In-Reply-To: <200812111239.41509.paul@codesourcery.com>
Paul Brook wrote:
>> void qemu_console_resize(DisplayState *ds, int width, int height, int bpp,
>> int linesize, uint8_t *data)
>> {
>> TextConsole *s = get_graphic_console();
>> s->g_width = width;
>> s->g_height = height;
>> if (is_graphic_console()) {
>> if (data && (bpp == 16 || bpp == 32)) {
>> qemu_freeDisplaySurface(ds->surface);
>> ds->surface = qemu_createDisplaySurfaceFrom(width, height, bpp,
>> linesize, data); } else {
>> ds->surface = qemu_resizeDisplaySurface(ds->surface, width,
>> height, 32, 4 * width); }
>> dpy_resize(ds);
>> }
>> }
>
> It feels wrong to be modifying the surface here. We already have to recreate
> the surface when we switch consoles, so why can't we use the same code for a
> resize?
We use mostly the same code already.
The following are the implementations of console_select and
qemu_console_resize in the last patch series I sent:
void console_select(unsigned int index)
{
TextConsole *s;
if (index >= MAX_CONSOLES)
return;
active_console->g_width = ds_get_width(active_console->ds);
active_console->g_height = ds_get_height(active_console->ds);
s = consoles[index];
if (s) {
DisplayState *ds = s->ds;
active_console = s;
ds->surface = qemu_resizeDisplaySurface(ds->surface, s->g_width,
s->g_height, 32, 4 * s->g_width);
dpy_resize(s->ds);
vga_hw_invalidate();
}
}
void qemu_console_resize(QEMUConsole *console, int width, int height)
{
console->g_width = width;
console->g_height = height;
if (active_console == console) {
DisplayState *ds = console->ds;
ds->surface = qemu_resizeDisplaySurface(ds->surface, width, height, 32, 4 * width);
dpy_resize(console->ds);
}
}
as you can see they both call qemu_resizeDisplaySurface and dpy_resize.
I was just saying that we could change qemu_console_resize to:
void qemu_console_resize(DisplayState *ds, int width, int height, int bpp,
int linesize, uint8_t *data)
in order to move the "artifact" away from vga.c, I am not sure if this
is desiderable.
next prev parent reply other threads:[~2008-12-11 15:22 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-26 17:47 [Qemu-devel] [PATCH 0 of 7] [UPDATE] DisplayState interface change Stefano Stabellini
2008-11-26 18:40 ` Paul Brook
2008-11-26 19:08 ` Stefano Stabellini
2008-11-27 23:42 ` Anthony Liguori
2008-11-28 0:29 ` Paul Brook
2008-12-02 19:35 ` Anthony Liguori
2008-12-11 11:55 ` Stefano Stabellini
2008-12-11 12:39 ` Paul Brook
2008-12-11 15:22 ` Stefano Stabellini [this message]
2008-12-11 15:29 ` Paul Brook
2008-12-11 15:37 ` Stefano Stabellini
2008-12-11 15:45 ` Paul Brook
2008-11-28 11:03 ` Stefano Stabellini
2008-12-02 19:33 ` Anthony Liguori
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=49413024.5020106@eu.citrix.com \
--to=stefano.stabellini@eu.citrix.com \
--cc=paul@codesourcery.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).