From: "Marc-André Lureau" <marcandre.lureau@gmail.com>
To: BALATON Zoltan <balaton@eik.bme.hu>
Cc: qemu-devel@nongnu.org,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"open list:sam460ex" <qemu-ppc@nongnu.org>
Subject: Re: [PATCH v2 16/18] hw/sm501: allow compiling without PIXMAN
Date: Tue, 10 Oct 2023 11:34:31 +0400 [thread overview]
Message-ID: <CAJ+F1C+w3mQY2B3A=-6TQyyCT9kZT2EEprnLygK7t7rKLSwBvw@mail.gmail.com> (raw)
In-Reply-To: <433e2db8-e85e-d1ce-e54f-80edadd71643@eik.bme.hu>
Hi Zoltan
On Mon, Sep 18, 2023 at 9:59 PM BALATON Zoltan <balaton@eik.bme.hu> wrote:
>
> On Mon, 18 Sep 2023, marcandre.lureau@redhat.com wrote:
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > Drop the "x-pixman" property and use fallback path in such case.
> >
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > ---
> > hw/display/sm501.c | 19 ++++++++++++++++---
> > 1 file changed, 16 insertions(+), 3 deletions(-)
> >
> > diff --git a/hw/display/sm501.c b/hw/display/sm501.c
> > index 0eecd00701..a897c82f04 100644
> > --- a/hw/display/sm501.c
> > +++ b/hw/display/sm501.c
> > @@ -730,7 +730,6 @@ static void sm501_2d_operation(SM501State *s)
> > switch (cmd) {
> > case 0: /* BitBlt */
> > {
> > - static uint32_t tmp_buf[16384];
> > unsigned int src_x = (s->twoD_source >> 16) & 0x01FFF;
> > unsigned int src_y = s->twoD_source & 0xFFFF;
> > uint32_t src_base = s->twoD_source_base & 0x03FFFFFF;
> > @@ -828,9 +827,11 @@ static void sm501_2d_operation(SM501State *s)
> > de = db + (width + (height - 1) * dst_pitch) * bypp;
> > overlap = (db < se && sb < de);
> > }
> > +#ifdef CONFIG_PIXMAN
> > if (overlap && (s->use_pixman & BIT(2))) {
> > /* pixman can't do reverse blit: copy via temporary */
> > int tmp_stride = DIV_ROUND_UP(width * bypp, sizeof(uint32_t));
> > + static uint32_t tmp_buf[16384];
> > uint32_t *tmp = tmp_buf;
> >
> > if (tmp_stride * sizeof(uint32_t) * height > sizeof(tmp_buf)) {
> > @@ -860,9 +861,12 @@ static void sm501_2d_operation(SM501State *s)
> > dst_pitch * bypp / sizeof(uint32_t),
> > 8 * bypp, 8 * bypp, src_x, src_y,
> > dst_x, dst_y, width, height);
> > - } else {
> > + } else
> > +#else
> > + {
> > fallback = true;
> > }
> > +#endif
> > if (fallback) {
> > uint8_t *sp = s->local_mem + src_base;
> > uint8_t *d = s->local_mem + dst_base;
> > @@ -894,10 +898,13 @@ static void sm501_2d_operation(SM501State *s)
> > color = cpu_to_le16(color);
> > }
> >
> > +#ifdef CONFIG_PIXMAN
> > if (!(s->use_pixman & BIT(0)) || (width == 1 && height == 1) ||
> > !pixman_fill((uint32_t *)&s->local_mem[dst_base],
> > dst_pitch * bypp / sizeof(uint32_t), 8 * bypp,
> > - dst_x, dst_y, width, height, color)) {
> > + dst_x, dst_y, width, height, color))
> > +#endif
> > + {
> > /* fallback when pixman failed or we don't want to call it */
> > uint8_t *d = s->local_mem + dst_base;
> > unsigned int x, y, i;
> > @@ -2038,7 +2045,9 @@ static void sm501_realize_sysbus(DeviceState *dev, Error **errp)
> >
> > static Property sm501_sysbus_properties[] = {
> > DEFINE_PROP_UINT32("vram-size", SM501SysBusState, vram_size, 0),
> > +#ifdef CONFIG_PIXMAN
> > DEFINE_PROP_UINT8("x-pixman", SM501SysBusState, state.use_pixman, 7),
> > +#endif
>
> Do we want to omit the property when compiled without pixman? I think we
> could leave it there and it would just be ignored without pixman but the
> same command line would still work and need less ifdefs in code.
That's a reasonable idea to me. At least, it can handle x-pixman=0
fine when !CONFIG_PIXMAN then.
Btw, looking at it, it seems it should be DEFINE_PROP_BIT instead. I
will add a TODO :)
>
> Otherwise:
>
> Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu>
>
> Regards,
> BALATON Zoltan
>
> > DEFINE_PROP_END_OF_LIST(),
> > };
> >
> > @@ -2126,7 +2135,9 @@ static void sm501_realize_pci(PCIDevice *dev, Error **errp)
> >
> > static Property sm501_pci_properties[] = {
> > DEFINE_PROP_UINT32("vram-size", SM501PCIState, vram_size, 64 * MiB),
> > +#ifdef CONFIG_PIXMAN
> > DEFINE_PROP_UINT8("x-pixman", SM501PCIState, state.use_pixman, 7),
> > +#endif
> > DEFINE_PROP_END_OF_LIST(),
> > };
> >
> > @@ -2169,8 +2180,10 @@ static void sm501_pci_class_init(ObjectClass *klass, void *data)
> >
> > static void sm501_pci_init(Object *o)
> > {
> > +#ifdef CONFIG_PIXMAN
> > object_property_set_description(o, "x-pixman", "Use pixman for: "
> > "1: fill, 2: blit, 4: overlap blit");
> > +#endif
> > }
> >
> > static const TypeInfo sm501_pci_info = {
> >
--
Marc-André Lureau
next prev parent reply other threads:[~2023-10-10 7:35 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-18 13:51 [PATCH v2 00/18] Make Pixman an optional dependency marcandre.lureau
2023-09-18 13:51 ` [PATCH v2 01/18] build-sys: add a "pixman" feature marcandre.lureau
2023-09-19 12:43 ` Paolo Bonzini
2023-09-18 13:51 ` [PATCH v2 02/18] ui: compile out some qemu-pixman functions when !PIXMAN marcandre.lureau
2023-09-18 13:51 ` [PATCH v2 03/18] ui: add pixman-compat.h marcandre.lureau
2023-09-18 13:51 ` [PATCH v2 04/18] ui/console: allow to override the default VC marcandre.lureau
2023-09-18 13:51 ` [PATCH v2 05/18] ui/vc: console-vc requires PIXMAN marcandre.lureau
2023-09-19 12:54 ` Paolo Bonzini
2023-09-18 13:51 ` [PATCH v2 06/18] qmp/hmp: disable screendump if PIXMAN is missing marcandre.lureau
2023-09-18 13:51 ` [PATCH v2 07/18] virtio-gpu: replace PIXMAN for region/rect test marcandre.lureau
2023-09-18 13:51 ` [PATCH v2 08/18] ui/console: when PIXMAN is unavailable, don't draw placeholder msg marcandre.lureau
2023-09-18 13:51 ` [PATCH v2 09/18] vhost-user-gpu: skip VHOST_USER_GPU_UPDATE when !PIXMAN marcandre.lureau
2023-09-19 12:56 ` Paolo Bonzini
2023-09-19 13:02 ` Marc-André Lureau
2023-09-18 13:51 ` [PATCH v2 10/18] ui/gl: opengl doesn't require PIXMAN marcandre.lureau
2023-09-18 13:51 ` [PATCH v2 11/18] ui/vnc: VNC requires PIXMAN marcandre.lureau
2023-09-18 13:51 ` [PATCH v2 12/18] ui/spice: SPICE/QXL " marcandre.lureau
2023-09-18 13:52 ` [PATCH v2 13/18] ui/gtk: -display gtk " marcandre.lureau
2023-09-18 13:52 ` [PATCH v2 14/18] ui/dbus: do not require PIXMAN marcandre.lureau
2023-09-18 13:52 ` [PATCH v2 15/18] arm/kconfig: XLNX_ZYNQMP_ARM depends on PIXMAN marcandre.lureau
2023-09-18 13:52 ` [PATCH v2 16/18] hw/sm501: allow compiling without PIXMAN marcandre.lureau
2023-09-18 17:58 ` BALATON Zoltan
2023-10-10 7:34 ` Marc-André Lureau [this message]
2023-10-10 9:52 ` BALATON Zoltan
2023-10-10 10:00 ` Marc-André Lureau
2023-10-10 10:09 ` BALATON Zoltan
2023-10-10 10:12 ` Marc-André Lureau
2023-10-10 10:24 ` BALATON Zoltan
2023-09-18 13:52 ` [PATCH v2 17/18] hw/display: make ATI_VGA depend on PIXMAN marcandre.lureau
2023-09-18 13:52 ` [PATCH v2 18/18] build-sys: make pixman actually optional marcandre.lureau
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='CAJ+F1C+w3mQY2B3A=-6TQyyCT9kZT2EEprnLygK7t7rKLSwBvw@mail.gmail.com' \
--to=marcandre.lureau@gmail.com \
--cc=balaton@eik.bme.hu \
--cc=berrange@redhat.com \
--cc=kraxel@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=thuth@redhat.com \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).