qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v9 1/7] hw/display/sm501: Add debug property to control pixma


From: BALATON Zoltan
Subject: Re: [PATCH v9 1/7] hw/display/sm501: Add debug property to control pixman usage
Date: Tue, 7 Mar 2023 16:15:34 +0100 (CET)

On Tue, 7 Mar 2023, Philippe Mathieu-Daudé wrote:
On 7/3/23 12:42, BALATON Zoltan wrote:
Add a property to allow disabling pixman and always use the fallbacks
for different operations which is useful for testing different drawing
methods or debugging pixman related issues.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Tested-by: Rene Engel <ReneEngel80@emailn.de>
---
  hw/display/sm501.c | 18 +++++++++++++++---
  1 file changed, 15 insertions(+), 3 deletions(-)


  static Property sm501_sysbus_properties[] = {
      DEFINE_PROP_UINT32("vram-size", SM501SysBusState, vram_size, 0),
+    DEFINE_PROP_UINT8("x-pixman", SM501SysBusState, state.use_pixman, 7),
      DEFINE_PROP_END_OF_LIST(),
  };
@@ -2122,6 +2126,7 @@ static void sm501_realize_pci(PCIDevice *dev, Error **errp)
    static Property sm501_pci_properties[] = {
      DEFINE_PROP_UINT32("vram-size", SM501PCIState, vram_size, 64 * MiB),
+    DEFINE_PROP_UINT8("x-pixman", SM501PCIState, state.use_pixman, 7),

FYI, alternatively:

DEFINE_PROP_BIT("x-pixman-fill", SM501PCIState, state.use_pixman, 0, 1),
DEFINE_PROP_BIT("x-pixman-blit", SM501PCIState, state.use_pixman, 1, 1),
DEFINE_PROP_BIT("x-pixman-overlap-blit", SM501PCIState,
               state.use_pixman, 2, 1),

Hmm, interesting but this would result in harder to use longer command lines. In this case when for a debug property expected to be used by experienced users a single value is easier to use.

Regards,
BALATON Zoltan

      DEFINE_PROP_END_OF_LIST(),
  };
@@ -2162,11 +2167,18 @@ static void sm501_pci_class_init(ObjectClass *klass, void *data)
      dc->vmsd = &vmstate_sm501_pci;
  }
  +static void sm501_pci_init(Object *o)
+{
+    object_property_set_description(o, "x-pixman", "Use pixman for: "
+                                    "1: fill, 2: blit, 4: overlap blit");
+}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]