[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v3 24/25] hw/display/ati: allow compiling without PIXMAN
|
From: |
marcandre . lureau |
|
Subject: |
[PULL v3 24/25] hw/display/ati: allow compiling without PIXMAN |
|
Date: |
Tue, 7 Nov 2023 14:15:22 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Change the "x-pixman" property default value and use the fallback path
when PIXMAN support is disabled.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: BALATON Zoltan <balaton@eik.bme.hu>
---
hw/display/ati.c | 15 ++++++++++++++-
hw/display/ati_2d.c | 10 ++++++++--
hw/display/meson.build | 2 +-
3 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/hw/display/ati.c b/hw/display/ati.c
index 9a87a5504a..569b8f6165 100644
--- a/hw/display/ati.c
+++ b/hw/display/ati.c
@@ -32,6 +32,12 @@
#define ATI_DEBUG_HW_CURSOR 0
+#ifdef CONFIG_PIXMAN
+#define DEFAULT_X_PIXMAN 3
+#else
+#define DEFAULT_X_PIXMAN 0
+#endif
+
static const struct {
const char *name;
uint16_t dev_id;
@@ -946,6 +952,12 @@ static void ati_vga_realize(PCIDevice *dev, Error **errp)
ATIVGAState *s = ATI_VGA(dev);
VGACommonState *vga = &s->vga;
+#ifndef CONFIG_PIXMAN
+ if (s->use_pixman != 0) {
+ warn_report("x-pixman != 0, not effective without PIXMAN");
+ }
+#endif
+
if (s->model) {
int i;
for (i = 0; i < ARRAY_SIZE(ati_model_aliases); i++) {
@@ -1033,7 +1045,8 @@ static Property ati_vga_properties[] = {
DEFINE_PROP_UINT16("x-device-id", ATIVGAState, dev_id,
PCI_DEVICE_ID_ATI_RAGE128_PF),
DEFINE_PROP_BOOL("guest_hwcursor", ATIVGAState, cursor_guest_mode, false),
- DEFINE_PROP_UINT8("x-pixman", ATIVGAState, use_pixman, 3),
+ /* this is a debug option, prefer PROP_UINT over PROP_BIT for simplicity */
+ DEFINE_PROP_UINT8("x-pixman", ATIVGAState, use_pixman, DEFAULT_X_PIXMAN),
DEFINE_PROP_END_OF_LIST()
};
diff --git a/hw/display/ati_2d.c b/hw/display/ati_2d.c
index 0e6b8e4367..309bb5ccb6 100644
--- a/hw/display/ati_2d.c
+++ b/hw/display/ati_2d.c
@@ -123,6 +123,7 @@ void ati_2d_blt(ATIVGAState *s)
src_bits, dst_bits, src_stride, dst_stride, bpp, bpp,
src_x, src_y, dst_x, dst_y,
s->regs.dst_width, s->regs.dst_height);
+#ifdef CONFIG_PIXMAN
if ((s->use_pixman & BIT(1)) &&
s->regs.dp_cntl & DST_X_LEFT_TO_RIGHT &&
s->regs.dp_cntl & DST_Y_TOP_TO_BOTTOM) {
@@ -147,7 +148,9 @@ void ati_2d_blt(ATIVGAState *s)
s->regs.dst_width, s->regs.dst_height);
}
g_free(tmp);
- } else {
+ } else
+#endif
+ {
fallback = true;
}
if (fallback) {
@@ -206,9 +209,12 @@ void ati_2d_blt(ATIVGAState *s)
DPRINTF("pixman_fill(%p, %d, %d, %d, %d, %d, %d, %x)\n",
dst_bits, dst_stride, bpp, dst_x, dst_y,
s->regs.dst_width, s->regs.dst_height, filler);
+#ifdef CONFIG_PIXMAN
if (!(s->use_pixman & BIT(0)) ||
!pixman_fill((uint32_t *)dst_bits, dst_stride, bpp, dst_x, dst_y,
- s->regs.dst_width, s->regs.dst_height, filler)) {
+ s->regs.dst_width, s->regs.dst_height, filler))
+#endif
+ {
/* fallback when pixman failed or we don't want to call it */
unsigned int x, y, i, bypp = bpp / 8;
unsigned int dst_pitch = dst_stride * sizeof(uint32_t);
diff --git a/hw/display/meson.build b/hw/display/meson.build
index 9c06aaee20..344dfe3d8c 100644
--- a/hw/display/meson.build
+++ b/hw/display/meson.build
@@ -62,7 +62,7 @@ system_ss.add(when: 'CONFIG_XLNX_DISPLAYPORT', if_true:
files('xlnx_dp.c'))
system_ss.add(when: 'CONFIG_ARTIST', if_true: files('artist.c'))
-system_ss.add(when: [pixman, 'CONFIG_ATI_VGA'], if_true: files('ati.c',
'ati_2d.c', 'ati_dbg.c'))
+system_ss.add(when: 'CONFIG_ATI_VGA', if_true: [files('ati.c', 'ati_2d.c',
'ati_dbg.c'), pixman])
if config_all_devices.has_key('CONFIG_VIRTIO_GPU')
--
2.41.0
- [PULL v3 11/25] qmp/hmp: disable screendump if PIXMAN is missing, (continued)
- [PULL v3 11/25] qmp/hmp: disable screendump if PIXMAN is missing, marcandre . lureau, 2023/11/07
- [PULL v3 13/25] ui/console: when PIXMAN is unavailable, don't draw placeholder msg, marcandre . lureau, 2023/11/07
- [PULL v3 12/25] virtio-gpu: replace PIXMAN for region/rect test, marcandre . lureau, 2023/11/07
- [PULL v3 16/25] ui/vnc: VNC requires PIXMAN, marcandre . lureau, 2023/11/07
- [PULL v3 18/25] ui/gtk: -display gtk requires PIXMAN, marcandre . lureau, 2023/11/07
- [PULL v3 19/25] ui/dbus: do not require PIXMAN, marcandre . lureau, 2023/11/07
- [PULL v3 20/25] arm/kconfig: XLNX_ZYNQMP_ARM depends on PIXMAN, marcandre . lureau, 2023/11/07
- [PULL v3 17/25] ui/spice: SPICE/QXL requires PIXMAN, marcandre . lureau, 2023/11/07
- [PULL v3 23/25] hw/mips: FULOONG depends on VT82C686, marcandre . lureau, 2023/11/07
- [PULL v3 15/25] ui/gl: opengl doesn't require PIXMAN, marcandre . lureau, 2023/11/07
- [PULL v3 24/25] hw/display/ati: allow compiling without PIXMAN,
marcandre . lureau <=
- [PULL v3 25/25] build-sys: make pixman actually optional, marcandre . lureau, 2023/11/07
- [PULL v3 21/25] hw/arm: XLNX_VERSAL depends on XLNX_CSU_DMA, marcandre . lureau, 2023/11/07
- [PULL v3 22/25] hw/sm501: allow compiling without PIXMAN, marcandre . lureau, 2023/11/07
- Re: [PULL v3 00/25] Pixman patches, Marc-André Lureau, 2023/11/07
- Re: [PULL v3 00/25] Pixman patches, Stefan Hajnoczi, 2023/11/07