From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 1 of 7] few more accessors
Date: Wed, 26 Nov 2008 17:47:09 +0000 [thread overview]
Message-ID: <492D8B9D.1010001@eu.citrix.com> (raw)
This patch introduces few more DisplayState accessors in hw/sm501.c.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
diff -r d8ccc2d27955 hw/sm501.c
--- a/hw/sm501.c Mon Nov 24 20:21:41 2008 +0000
+++ b/hw/sm501.c Wed Nov 26 16:33:07 2008 +0000
@@ -955,7 +955,7 @@
static inline int get_depth_index(DisplayState *s)
{
- switch(s->depth) {
+ switch(ds_get_bits_per_pixel(s)) {
default:
case 8:
return 0;
@@ -985,7 +985,7 @@
uint8_t * src = s->local_mem;
int src_bpp = 0;
- int dst_bpp = s->ds->depth / 8 + (s->ds->depth % 8 ? 1 : 0);
+ int dst_bpp = ds_get_bytes_per_pixel(s->ds) + (ds_get_bits_per_pixel(s->ds) % 8 ? 1 : 0);
uint32_t * palette = (uint32_t *)&s->dc_palette[SM501_DC_CRT_PALETTE
- SM501_DC_PANEL_PALETTE];
int ds_depth_index = get_depth_index(s->ds);
@@ -1039,7 +1039,7 @@
/* draw line and change status */
if (update) {
- draw_line(&s->ds->data[y * width * dst_bpp], src, width, palette);
+ draw_line(&(ds_get_data(s->ds)[y * width * dst_bpp]), src, width, palette);
if (y_start < 0)
y_start = y;
if (page0 < page_min)
next reply other threads:[~2008-11-26 17:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-26 17:47 Stefano Stabellini [this message]
2008-12-02 19:25 ` [Qemu-devel] [PATCH 1 of 7] few more accessors Anthony Liguori
2008-12-11 11:20 ` Stefano Stabellini
-- strict thread matches above, loose matches on Subject: below --
2008-12-18 19:12 Stefano Stabellini
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=492D8B9D.1010001@eu.citrix.com \
--to=stefano.stabellini@eu.citrix.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).