From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 13/14] [wip] pl110: switch some conversions to swap+pixman mode
Date: Tue, 2 Sep 2014 10:00:26 +0200 [thread overview]
Message-ID: <1409644827-26317-14-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1409644827-26317-1-git-send-email-kraxel@redhat.com>
Add swapmode to struct pl110_draw_fn,
handle more framebuffer formats that way.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/display/pl110.c | 26 +++++++++++++++++---------
hw/display/pl110_template.h | 45 +++++++++++++++++++++++++++++++++++----------
2 files changed, 52 insertions(+), 19 deletions(-)
diff --git a/hw/display/pl110.c b/hw/display/pl110.c
index 0dbc526..6d8ae4b 100644
--- a/hw/display/pl110.c
+++ b/hw/display/pl110.c
@@ -205,7 +205,8 @@ static void pl110_update_display(void *opaque)
if (s->invalidate ||
surface_width(surface) != s->cols ||
surface_height(surface) != s->rows) {
- if (pl110_draw[bpp_offset].fmt) {
+ if (pl110_draw[bpp_offset].fmt &&
+ pl110_draw[bpp_offset].swap == FB_SWAP_NONE) {
surface = qemu_create_displaysurface_guestmem
(s->cols, s->rows, pl110_draw[bpp_offset].fmt, 0, s->upbase);
dpy_gfx_replace_surface(s->con, surface);
@@ -223,15 +224,22 @@ static void pl110_update_display(void *opaque)
s->upbase, s->invalidate);
} else {
g_assert(surface_bits_per_pixel(surface) == 32);
- dest_width = 4 * s->cols;
first = 0;
- fn = pl110_draw[bpp_offset].fn;
- framebuffer_update_display(surface, sysbus_address_space(sbd),
- s->upbase, s->cols, s->rows,
- src_width, dest_width, 0,
- s->invalidate,
- fn, s->palette,
- &first, &last);
+ if (pl110_draw[bpp_offset].fmt) {
+ framebuffer_update_display_swap_pixman
+ (surface, sysbus_address_space(sbd), s->upbase,
+ pl110_draw[bpp_offset].swap, pl110_draw[bpp_offset].fmt,
+ s->invalidate, &first, &last);
+ } else {
+ dest_width = 4 * s->cols;
+ fn = pl110_draw[bpp_offset].fn;
+ framebuffer_update_display(surface, sysbus_address_space(sbd),
+ s->upbase, s->cols, s->rows,
+ src_width, dest_width, 0,
+ s->invalidate,
+ fn, s->palette,
+ &first, &last);
+ }
if (first >= 0) {
dpy_gfx_update(s->con, 0, first, s->cols, last - first + 1);
}
diff --git a/hw/display/pl110_template.h b/hw/display/pl110_template.h
index 1eee28d..d81a388 100644
--- a/hw/display/pl110_template.h
+++ b/hw/display/pl110_template.h
@@ -41,16 +41,29 @@
static struct {
drawfn fn;
pixman_format_code_t fmt;
+ enum framebuffer_swapmode swap;
} pl110_draw[48] = {
{ .fn = pl110_draw_line1_lblp_bgr },
{ .fn = pl110_draw_line2_lblp_bgr },
{ .fn = pl110_draw_line4_lblp_bgr },
{ .fn = pl110_draw_line8_lblp_bgr },
- { .fn = pl110_draw_line16_555_lblp_bgr, .fmt = LEBE(PIXMAN_x1r5g5b5, 0) },
- { .fn = pl110_draw_line32_lblp_bgr, .fmt = LEBE(PIXMAN_x8r8g8b8,
- PIXMAN_b8g8r8a8) },
- { .fn = pl110_draw_line16_lblp_bgr, .fmt = LEBE(PIXMAN_r5g6b5, 0) },
- { .fn = pl110_draw_line12_lblp_bgr, .fmt = LEBE(PIXMAN_x4r4g4b4, 0) },
+ {
+ .fn = pl110_draw_line16_555_lblp_bgr,
+ .fmt = PIXMAN_x1r5g5b5,
+ .swap = LEBE(FB_SWAP_NONE, FB_SWAP_16_BYTES),
+ },{
+ .fn = pl110_draw_line32_lblp_bgr,
+ .fmt = LEBE(PIXMAN_x8r8g8b8, PIXMAN_b8g8r8a8),
+ .swap = FB_SWAP_NONE
+ },{
+ .fn = pl110_draw_line16_lblp_bgr,
+ .fmt = PIXMAN_r5g6b5,
+ .swap = LEBE(FB_SWAP_NONE, FB_SWAP_16_BYTES),
+ },{
+ .fn = pl110_draw_line12_lblp_bgr,
+ .fmt = PIXMAN_x4r4g4b4,
+ .swap = LEBE(FB_SWAP_NONE, FB_SWAP_16_BYTES)
+ },
{ .fn = pl110_draw_line1_bbbp_bgr },
{ .fn = pl110_draw_line2_bbbp_bgr },
@@ -66,11 +79,23 @@ static struct {
{ .fn = pl110_draw_line2_lbbp_bgr },
{ .fn = pl110_draw_line4_lbbp_bgr },
{ .fn = pl110_draw_line8_lbbp_bgr },
- { .fn = pl110_draw_line16_555_lbbp_bgr, .fmt = LEBE(PIXMAN_x1r5g5b5, 0) },
- { .fn = pl110_draw_line32_lbbp_bgr, .fmt = LEBE(PIXMAN_x8r8g8b8,
- PIXMAN_b8g8r8a8) },
- { .fn = pl110_draw_line16_lbbp_bgr, .fmt = LEBE(PIXMAN_r5g6b5, 0) },
- { .fn = pl110_draw_line12_lbbp_bgr, .fmt = LEBE(PIXMAN_x4r4g4b4, 0) },
+ {
+ .fn = pl110_draw_line16_555_lbbp_bgr,
+ .fmt = PIXMAN_x1r5g5b5,
+ .swap = LEBE(FB_SWAP_NONE, FB_SWAP_16_BYTES),
+ },{
+ .fn = pl110_draw_line32_lbbp_bgr,
+ .fmt = LEBE(PIXMAN_x8r8g8b8, PIXMAN_b8g8r8a8),
+ .swap = FB_SWAP_NONE
+ },{
+ .fn = pl110_draw_line16_lbbp_bgr,
+ .fmt = PIXMAN_r5g6b5,
+ .swap = LEBE(FB_SWAP_NONE, FB_SWAP_16_BYTES),
+ },{
+ .fn = pl110_draw_line12_lbbp_bgr,
+ .fmt = PIXMAN_x4r4g4b4,
+ .swap = LEBE(FB_SWAP_NONE, FB_SWAP_16_BYTES)
+ },
{ .fn = pl110_draw_line1_lblp_rgb },
{ .fn = pl110_draw_line2_lblp_rgb },
--
1.8.3.1
next prev parent reply other threads:[~2014-09-02 8:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-02 8:00 [Qemu-devel] [PATCH 00/14] console/pl110: pixman conversion continued Gerd Hoffmann
2014-09-02 8:00 ` [Qemu-devel] [PATCH 01/14] console: add qemu_pixelformat_from_pixman Gerd Hoffmann
2014-09-02 8:00 ` [Qemu-devel] [PATCH 02/14] console: add qemu_default_pixman_format Gerd Hoffmann
2014-09-02 8:00 ` [Qemu-devel] [PATCH 03/14] console: reimplement qemu_default_pixelformat Gerd Hoffmann
2014-09-02 8:00 ` [Qemu-devel] [PATCH 04/14] console: stop using PixelFormat Gerd Hoffmann
2014-09-02 8:00 ` [Qemu-devel] [PATCH 05/14] console: add qemu_create_displaysurface_guestmem Gerd Hoffmann
2014-09-02 8:00 ` [Qemu-devel] [PATCH 06/14] console: add dpy_gfx_update_dirty Gerd Hoffmann
2014-09-02 8:00 ` [Qemu-devel] [PATCH 07/14] console: add qemu_pixman_linebuf_copy Gerd Hoffmann
2014-09-02 8:00 ` [Qemu-devel] [PATCH 08/14] console: Remove unused QEMU_BIG_ENDIAN_FLAG Gerd Hoffmann
2014-09-02 8:00 ` [Qemu-devel] [PATCH 09/14] pl110: add framebuffer_update_display_swap_pixman Gerd Hoffmann
2014-09-02 8:00 ` [Qemu-devel] [PATCH 10/14] pl100: Drop support for depths other than 32bpp Gerd Hoffmann
2014-09-02 8:00 ` [Qemu-devel] [PATCH 11/14] pl110: move resize Gerd Hoffmann
2014-09-02 8:00 ` [Qemu-devel] [PATCH 12/14] [wip] pl110: start using pixman Gerd Hoffmann
2014-09-02 8:00 ` Gerd Hoffmann [this message]
2014-09-02 8:00 ` [Qemu-devel] [PATCH 14/14] [wip] pl110: start handling paletted images via pixman Gerd Hoffmann
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=1409644827-26317-14-git-send-email-kraxel@redhat.com \
--to=kraxel@redhat.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).