[PULL 27/31] hw/display/apple-gfx: Replace QemuSemaphore with QemuEvent

2025-06-06 Thread Paolo Bonzini
From: Akihiko Odaki sem in AppleGFXReadMemoryJob is an one-shot event so it can be converted into QemuEvent, which is more specialized for such a use case. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé Link: https://lore.kernel.org/r/20250529-event-v5-10-53b285203...@daynix.

[PATCH v5 10/13] hw/display/apple-gfx: Replace QemuSemaphore with QemuEvent

2025-05-28 Thread Akihiko Odaki
sem in AppleGFXReadMemoryJob is an one-shot event so it can be converted into QemuEvent, which is more specialized for such a use case. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/display/apple-gfx.m | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) d

Re: [PATCH v4 11/11] hw/display/apple-gfx: Replace QemuSemaphore with QemuEvent

2025-05-28 Thread Akihiko Odaki
On 2025/05/26 18:29, Philippe Mathieu-Daudé wrote: On 26/5/25 11:27, Philippe Mathieu-Daudé wrote: On 26/5/25 07:29, Akihiko Odaki wrote: sem in AppleGFXReadMemoryJob is an one-shot event so it can be converted into QemuEvent, which is more specialized for such a use case. BTW it would be nic

Re: [PATCH v4 11/11] hw/display/apple-gfx: Replace QemuSemaphore with QemuEvent

2025-05-26 Thread Philippe Mathieu-Daudé
On 26/5/25 07:29, Akihiko Odaki wrote: sem in AppleGFXReadMemoryJob is an one-shot event so it can be converted into QemuEvent, which is more specialized for such a use case. Signed-off-by: Akihiko Odaki --- hw/display/apple-gfx.m | 10 +- 1 file changed, 5 insertions(+), 5 deletions

Re: [PATCH v4 11/11] hw/display/apple-gfx: Replace QemuSemaphore with QemuEvent

2025-05-26 Thread Philippe Mathieu-Daudé
On 26/5/25 11:27, Philippe Mathieu-Daudé wrote: On 26/5/25 07:29, Akihiko Odaki wrote: sem in AppleGFXReadMemoryJob is an one-shot event so it can be converted into QemuEvent, which is more specialized for such a use case. BTW it would be nice to document that in "qemu/thread.h" API. Signed

[PATCH v4 11/11] hw/display/apple-gfx: Replace QemuSemaphore with QemuEvent

2025-05-25 Thread Akihiko Odaki
sem in AppleGFXReadMemoryJob is an one-shot event so it can be converted into QemuEvent, which is more specialized for such a use case. Signed-off-by: Akihiko Odaki --- hw/display/apple-gfx.m | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/display/apple-gfx.m b/

[PATCH v3 10/10] hw/display/apple-gfx: Replace QemuSemaphore with QemuEvent

2025-05-10 Thread Akihiko Odaki
sem in AppleGFXReadMemoryJob is an one-shot event so it can be converted into QemuEvent, which is more specialized for such a use case. Signed-off-by: Akihiko Odaki --- hw/display/apple-gfx.m | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/display/apple-gfx.m b/

[PATCH v2 9/9] hw/display/apple-gfx: Replace QemuSemaphore with QemuEvent

2025-05-10 Thread Akihiko Odaki
sem in AppleGFXReadMemoryJob is an one-shot event so it can be converted into QemuEvent, which is more specialized for such a use case. Signed-off-by: Akihiko Odaki --- hw/display/apple-gfx.m | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/display/apple-gfx.m b/

[PULL 26/29] hw/display/apple-gfx: Adds configurable mode list

2024-12-31 Thread Philippe Mathieu-Daudé
igned-off-by: Philippe Mathieu-Daudé --- hw/display/apple-gfx.h | 10 +++ hw/display/apple-gfx-mmio.m | 7 ++ hw/display/apple-gfx-pci.m | 8 ++- hw/display/apple-gfx.m | 130 +++- hw/display/trace-events | 2 + 5 files changed, 139 insertions

[PULL 25/29] hw/display/apple-gfx: Adds PCI implementation

2024-12-31 Thread Philippe Mathieu-Daudé
Phil Dennis-Jordan Reviewed-by: Akihiko Odaki Message-ID: <20241223221645.29911-4-p...@philjordan.eu> Signed-off-by: Philippe Mathieu-Daudé --- hw/display/apple-gfx.h | 1 + hw/display/Kconfig | 4 + hw/display/apple-gfx-pci.m | 151 +

[PULL 24/29] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-12-31 Thread Philippe Mathieu-Daudé
/apple-gfx.h | 63 +++ hw/display/Kconfig | 9 + hw/display/apple-gfx-mmio.m | 278 + hw/display/apple-gfx.m | 783 hw/display/meson.build | 6 + hw/display/trace-events | 28 ++ 7 files changed, 1171 insertions(+)

[PATCH v16 03/14] hw/display/apple-gfx: Adds PCI implementation

2024-12-23 Thread Phil Dennis-Jordan
call. * Whitespace and comment formatting tweaks. v11: * Comment formatting fix. hw/display/Kconfig | 4 + hw/display/apple-gfx-pci.m | 150 + hw/display/meson.build | 1 + 3 files changed, 155 insertions(+) create mode 100644 hw/display/apple-gfx-

[PATCH v16 02/14] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-12-23 Thread Phil Dennis-Jordan
| 4 + 7 files changed, 1177 insertions(+) create mode 100644 hw/display/apple-gfx-mmio.m create mode 100644 hw/display/apple-gfx.h create mode 100644 hw/display/apple-gfx.m diff --git a/hw/display/Kconfig b/hw/display/Kconfig index 2250c74007..6a9b7b19ad 100644 --- a/hw/

[PATCH v16 04/14] hw/display/apple-gfx: Adds configurable mode list

2024-12-23 Thread Phil Dennis-Jordan
mporary array - previously done with alloca. v7: * Simplified error handling in property parsing v8: * More consistent integer variable types. v9: * Re-ordered type definitions so we can drop a 'struct' keyword. v15: * Constified the property table. v16: * Removed the DEFINE_PROP

[PATCH v15 03/15] hw/display/apple-gfx: Adds PCI implementation

2024-12-18 Thread Phil Dennis-Jordan
call. * Whitespace and comment formatting tweaks. v11: * Comment formatting fix. hw/display/Kconfig | 4 + hw/display/apple-gfx-pci.m | 150 + hw/display/meson.build | 1 + 3 files changed, 155 insertions(+) create mode 100644 hw/display/apple-gfx-

[PATCH v15 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-12-18 Thread Phil Dennis-Jordan
retain/release of command buffers when handing off to a non-BH thread. (Problem masked at runtime by above leak.) * Better handling of render command encoding errors. * Re-arranged positions of static variables in the file. hw/display/Kconfig | 9 + hw/display/apple-gfx-mmio

[PATCH v15 04/15] hw/display/apple-gfx: Adds configurable mode list

2024-12-18 Thread Phil Dennis-Jordan
mporary array - previously done with alloca. v7: * Simplified error handling in property parsing v8: * More consistent integer variable types. v9: * Re-ordered type definitions so we can drop a 'struct' keyword. v15: * Constified the property table. hw/display/apple-gfx-mmio.m |

[PATCH v14 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-12-13 Thread Phil Dennis-Jordan
retain/release of command buffers when handing off to a non-BH thread. (Problem masked at runtime by above leak.) * Better handling of render command encoding errors. * Re-arranged positions of static variables in the file. hw/display/Kconfig | 9 + hw/display/apple-gfx-mmio

[PATCH v14 04/15] hw/display/apple-gfx: Adds configurable mode list

2024-12-13 Thread Phil Dennis-Jordan
mporary array - previously done with alloca. v7: * Simplified error handling in property parsing v8: * More consistent integer variable types. v9: * Re-ordered type definitions so we can drop a 'struct' keyword. hw/display/apple-gfx-mmio.m | 8 +++ hw/display/apple-gfx-pci.m |

[PATCH v14 03/15] hw/display/apple-gfx: Adds PCI implementation

2024-12-13 Thread Phil Dennis-Jordan
call. * Whitespace and comment formatting tweaks. v11: * Comment formatting fix. hw/display/Kconfig | 4 + hw/display/apple-gfx-pci.m | 150 + hw/display/meson.build | 1 + 3 files changed, 155 insertions(+) create mode 100644 hw/display/apple-gfx-

[PATCH v13 04/15] hw/display/apple-gfx: Adds configurable mode list

2024-12-13 Thread Phil Dennis-Jordan
mporary array - previously done with alloca. v7: * Simplified error handling in property parsing v8: * More consistent integer variable types. v9: * Re-ordered type definitions so we can drop a 'struct' keyword. hw/display/apple-gfx-mmio.m | 8 +++ hw/display/apple-gfx-pci.m |

[PATCH v13 03/15] hw/display/apple-gfx: Adds PCI implementation

2024-12-13 Thread Phil Dennis-Jordan
call. * Whitespace and comment formatting tweaks. v11: * Comment formatting fix. hw/display/Kconfig | 4 + hw/display/apple-gfx-pci.m | 150 + hw/display/meson.build | 1 + 3 files changed, 155 insertions(+) create mode 100644 hw/display/apple-gfx-

[PATCH v13 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-12-13 Thread Phil Dennis-Jordan
retain/release of command buffers when handing off to a non-BH thread. (Problem masked at runtime by above leak.) * Better handling of render command encoding errors. * Re-arranged positions of static variables in the file. hw/display/Kconfig | 9 + hw/display/apple-gfx-mmio

[PATCH v13 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-12-08 Thread Phil Dennis-Jordan
retain/release of command buffers when handing off to a non-BH thread. (Problem masked at runtime by above leak.) * Better handling of render command encoding errors. * Re-arranged positions of static variables in the file. hw/display/Kconfig | 9 + hw/display/apple-gfx-mmio

[PATCH v13 04/15] hw/display/apple-gfx: Adds configurable mode list

2024-12-08 Thread Phil Dennis-Jordan
mporary array - previously done with alloca. v7: * Simplified error handling in property parsing v8: * More consistent integer variable types. v9: * Re-ordered type definitions so we can drop a 'struct' keyword. hw/display/apple-gfx-mmio.m | 8 +++ hw/display/apple-gfx-pci.m |

[PATCH v13 03/15] hw/display/apple-gfx: Adds PCI implementation

2024-12-08 Thread Phil Dennis-Jordan
call. * Whitespace and comment formatting tweaks. v11: * Comment formatting fix. hw/display/Kconfig | 4 + hw/display/apple-gfx-pci.m | 150 + hw/display/meson.build | 1 + 3 files changed, 155 insertions(+) create mode 100644 hw/display/apple-gfx-

Re: [PATCH v12 04/15] hw/display/apple-gfx: Adds configurable mode list

2024-11-29 Thread Akihiko Odaki
On 2024/11/30 0:24, Phil Dennis-Jordan wrote: This change adds a property 'display_modes' on the graphics device which permits specifying a list of display modes. (screen resolution and refresh rate) The property is an array of a custom type to make the syntax slightly less awkward to use, for e

Re: [PATCH v12 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-29 Thread Akihiko Odaki
On 2024/11/30 0:24, Phil Dennis-Jordan wrote: MacOS provides a framework (library) that allows any vmm to implement a paravirtualized 3d graphics passthrough to the host metal stack called ParavirtualizedGraphics.Framework (PVG). The library abstracts away almost every aspect of the paravirtualiz

[PATCH v12 04/15] hw/display/apple-gfx: Adds configurable mode list

2024-11-29 Thread Phil Dennis-Jordan
ne with alloca. v7: * Simplified error handling in property parsing v8: * More consistent integer variable types. v9: * Re-ordered type definitions so we can drop a 'struct' keyword. hw/display/apple-gfx-mmio.m | 8 +++ hw/display/apple-gfx-pci.m |

[PATCH v12 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-29 Thread Phil Dennis-Jordan
f to a non-BH thread. (Problem masked at runtime by above leak.) * Better handling of render command encoding errors. * Re-arranged positions of static variables in the file. hw/display/Kconfig | 9 + hw/display/apple-gfx-mmio.m | 281 + hw/disp

[PATCH v12 03/15] hw/display/apple-gfx: Adds PCI implementation

2024-11-29 Thread Phil Dennis-Jordan
call. * Whitespace and comment formatting tweaks. v11: * Comment formatting fix. hw/display/Kconfig | 4 + hw/display/apple-gfx-pci.m | 150 + hw/display/meson.build | 1 + 3 files changed, 155 insertions(+) create mode 100644 hw/display/apple-gfx-

Re: [PATCH v11 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-28 Thread Phil Dennis-Jordan
related code. > > * Some adjustments to types used. > > * Variable naming tweaks for better clarity. > > * Fixed leak in unlikely realize error case. > > * Fixed typo in unmap call. > > * Don't bother with dummy argument for g_ptr_array_find(), NULL works &g

Re: [PATCH v11 03/15] hw/display/apple-gfx: Adds PCI implementation

2024-11-28 Thread Akihiko Odaki
On 2024/11/28 0:02, Phil Dennis-Jordan wrote: This change wires up the PCI variant of the paravirtualised graphics device, mainly useful for x86-64 macOS guests, implemented by macOS's ParavirtualizedGraphics.framework. It builds on code shared with the vmapple/mmio variant of the PVG device. Si

Re: [PATCH v11 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-28 Thread Akihiko Odaki
dering code is threaded to use BHs for sections requiring BQL. * Fix for ./configure error on non-macOS platforms. * Code formatting tweaks. v11: * Generate unique display serial number for each apple-gfx device instance. * Dropped redundant local variable initialisation. hw/dis

[PATCH v11 03/15] hw/display/apple-gfx: Adds PCI implementation

2024-11-27 Thread Phil Dennis-Jordan
tting tweaks. v11: * Comment formatting fix. hw/display/Kconfig | 4 + hw/display/apple-gfx-pci.m | 150 + hw/display/meson.build | 1 + 3 files changed, 155 insertions(+) create mode 100644 hw/display/apple-gfx-pci.m diff --git a/hw/di

[PATCH v11 04/15] hw/display/apple-gfx: Adds configurable mode list

2024-11-27 Thread Phil Dennis-Jordan
ne with alloca. v7: * Simplified error handling in property parsing v8: * More consistent integer variable types. v9: * Re-ordered type definitions so we can drop a 'struct' keyword. hw/display/apple-gfx-mmio.m | 8 +++ hw/display/apple-gfx-pci.m |

[PATCH v11 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-27 Thread Phil Dennis-Jordan
tweaks. v11: * Generate unique display serial number for each apple-gfx device instance. * Dropped redundant local variable initialisation. hw/display/Kconfig | 9 + hw/display/apple-gfx-mmio.m | 281 + hw/display/apple-gfx.h | 67 hw/display/apple-gfx.m |

Re: [PATCH v10 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-27 Thread Phil Dennis-Jordan
On Wed, 27 Nov 2024 at 07:18, Akihiko Odaki wrote: > On 2024/11/13 23:23, Phil Dennis-Jordan wrote: > […] > > +static void apple_gfx_render_new_frame(AppleGFXState *s) > > +{ > > +bool managed_texture = s->using_managed_texture_storage; > > +uint32_t width = surface_width(s->surface); > >

Re: [PATCH v10 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-27 Thread Phil Dennis-Jordan
On Wed, 27 Nov 2024 at 07:45, Akihiko Odaki wrote: > > +s->pgdev = PGNewDeviceWithDescriptor(desc); > > + > > +disp_desc = apple_gfx_prepare_display_descriptor(s); > > +s->pgdisp = [s->pgdev newDisplayWithDescriptor:disp_desc > > + port:0 s

Re: [PATCH v10 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-26 Thread Akihiko Odaki
dering code is threaded to use BHs for sections requiring BQL. * Fix for ./configure error on non-macOS platforms. * Code formatting tweaks. hw/display/Kconfig | 9 + hw/display/apple-gfx-mmio.m | 281 + hw/display/apple-gfx.h | 67 hw/display/apple-g

Re: [PATCH v10 03/15] hw/display/apple-gfx: Adds PCI implementation

2024-11-26 Thread Akihiko Odaki
up of changed common call. * Whitespace and comment formatting tweaks. hw/display/Kconfig | 4 + hw/display/apple-gfx-pci.m | 150 + hw/display/meson.build | 1 + 3 files changed, 155 insertions(+) create mode 100644 hw/display/apple-gfx-

Re: [PATCH v10 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-26 Thread Akihiko Odaki
dering code is threaded to use BHs for sections requiring BQL. * Fix for ./configure error on non-macOS platforms. * Code formatting tweaks. hw/display/Kconfig | 9 + hw/display/apple-gfx-mmio.m | 281 + hw/display/apple-gfx.h | 67 hw/display/apple-g

[PATCH v10 04/15] hw/display/apple-gfx: Adds configurable mode list

2024-11-13 Thread Phil Dennis-Jordan
ne with alloca. v7: * Simplified error handling in property parsing v8: * More consistent integer variable types. v9: * Re-ordered type definitions so we can drop a 'struct' keyword. hw/display/apple-gfx-mmio.m | 8 +++ hw/display/apple-gfx-pci.m |

[PATCH v10 03/15] hw/display/apple-gfx: Adds PCI implementation

2024-11-13 Thread Phil Dennis-Jordan
tting tweaks. hw/display/Kconfig | 4 + hw/display/apple-gfx-pci.m | 150 + hw/display/meson.build | 1 + 3 files changed, 155 insertions(+) create mode 100644 hw/display/apple-gfx-pci.m diff --git a/hw/display/Kconfig b/hw/display/Kconfig

[PATCH v10 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-13 Thread Phil Dennis-Jordan
d error handling during realize(). * Simplified code without functional changes, adjusted code & comment formatting. v10: * Reworked the way frame rendering code is threaded to use BHs for sections requiring BQL. * Fix for ./configure error on non-macOS platforms. * Code formatting tw

Re: [PATCH v9 02/16] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-13 Thread Phil Dennis-Jordan
d code. > > * Some adjustments to types used. > > * Variable naming tweaks for better clarity. > > * Fixed leak in unlikely realize error case. > > * Fixed typo in unmap call. > > * Don't bother with dummy argument for g_ptr_array_find(), NULL works > t

Re: [PATCH v9 04/16] hw/display/apple-gfx: Adds configurable mode list

2024-11-10 Thread Akihiko Odaki
On 2024/11/11 6:55, Phil Dennis-Jordan wrote: This change adds a property 'display_modes' on the graphics device which permits specifying a list of display modes. (screen resolution and refresh rate) The property is an array of a custom type to make the syntax slightly less awkward to use, for e

Re: [PATCH v9 02/16] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-10 Thread Akihiko Odaki
rray_find(), NULL works too. v9: * Pass device pointer to graphic_console_init(). * Slightly re-ordered initialisation code. * Simplified error handling during realize(). * Simplified code without functional changes, adjusted code & comment formatting. hw/display/Kconfig | 9

Re: [PATCH v8 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-10 Thread Akihiko Odaki
riable naming tweaks for better clarity. * Fixed leak in unlikely realize error case. * Fixed typo in unmap call. * Don't bother with dummy argument for g_ptr_array_find(), NULL works too. hw/display/Kconfig | 9 + hw/display/apple-gfx-mmio.m | 282 + hw

[PATCH v9 02/16] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-10 Thread Phil Dennis-Jordan
d error handling during realize(). * Simplified code without functional changes, adjusted code & comment formatting. hw/display/Kconfig | 9 + hw/display/apple-gfx-mmio.m | 281 + hw/display/apple-gfx.h | 65 +++ hw/display/apple-gfx.m | 764

[PATCH v9 03/16] hw/display/apple-gfx: Adds PCI implementation

2024-11-10 Thread Phil Dennis-Jordan
tting tweaks. hw/display/Kconfig | 4 + hw/display/apple-gfx-pci.m | 150 + hw/display/meson.build | 1 + 3 files changed, 155 insertions(+) create mode 100644 hw/display/apple-gfx-pci.m diff --git a/hw/display/Kconfig b/hw/display/Kconfig

[PATCH v9 04/16] hw/display/apple-gfx: Adds configurable mode list

2024-11-10 Thread Phil Dennis-Jordan
Simplified error handling in property parsing v8: * More consistent integer variable types. v9: * Re-ordered type definitions so we can drop a 'struct' keyword. hw/display/apple-gfx-mmio.m | 8 +++ hw/display/apple-gfx-pci.m | 9 ++- hw/display/apple-gfx.h | 11 +++ hw/displ

Re: [PATCH v8 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-10 Thread Phil Dennis-Jordan
y regions. Just look > > up > > and ref/unref the memory regions in the map/unmap callbacks. > > * Re-ordered functions in apple-gfx.m to group them by area of > > functionality. > > * Improved comments and tweaked some names. > > > > v7: > > >

Re: [PATCH v8 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-10 Thread Akihiko Odaki
meson.build | 4 + 7 files changed, 1161 insertions(+) create mode 100644 hw/display/apple-gfx-mmio.m create mode 100644 hw/display/apple-gfx.h create mode 100644 hw/display/apple-gfx.m diff --git a/hw/display/Kconfig b/hw/display/Kconfig index 2250c740078..6a9b7b19ada 10064

Re: [PATCH v8 04/15] hw/display/apple-gfx: Adds configurable mode list

2024-11-09 Thread Akihiko Odaki
porary array - previously done with alloca. v7: * Simplified error handling in property parsing v8: * More consistent integer variable types. hw/display/apple-gfx-mmio.m | 8 +++ hw/display/apple-gfx-pci.m | 9 ++- hw/display/apple-gfx.h | 12 hw/display/apple-gfx.m

Re: [PATCH v8 03/15] hw/display/apple-gfx: Adds PCI implementation

2024-11-09 Thread Akihiko Odaki
onfig | 4 + hw/display/apple-gfx-pci.m | 148 + hw/display/meson.build | 1 + 3 files changed, 153 insertions(+) create mode 100644 hw/display/apple-gfx-pci.m diff --git a/hw/display/Kconfig b/hw/display/Kconfig index 6a9b7b19ada..2b53df

Re: [PATCH v8 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-09 Thread Akihiko Odaki
meson.build | 4 + 7 files changed, 1161 insertions(+) create mode 100644 hw/display/apple-gfx-mmio.m create mode 100644 hw/display/apple-gfx.h create mode 100644 hw/display/apple-gfx.m diff --git a/hw/display/Kconfig b/hw/display/Kconfig index 2250c740078..6a9b7b19ada 10064

[PATCH v8 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-08 Thread Phil Dennis-Jordan
ing tweaks for better clarity. * Fixed leak in unlikely realize error case. * Fixed typo in unmap call. * Don't bother with dummy argument for g_ptr_array_find(), NULL works too. hw/display/Kconfig | 9 + hw/display/apple-gfx-mmio.m | 282 + hw/display/

[PATCH v8 04/15] hw/display/apple-gfx: Adds configurable mode list

2024-11-08 Thread Phil Dennis-Jordan
Simplified error handling in property parsing v8: * More consistent integer variable types. hw/display/apple-gfx-mmio.m | 8 +++ hw/display/apple-gfx-pci.m | 9 ++- hw/display/apple-gfx.h | 12 hw/display/apple-gfx.m | 136 +++- hw/display/trac

[PATCH v8 03/15] hw/display/apple-gfx: Adds PCI implementation

2024-11-08 Thread Phil Dennis-Jordan
- v4: * Threading improvements analogous to those in common apple-gfx code and mmio device variant. * Smaller code review issues addressed. v5: * Minor error handling improvement. v6: * Removed an unused function parameter. hw/display/Kconfig | 4 + hw/display/apple-gfx-pci.m

Re: [PATCH v7 04/15] hw/display/apple-gfx: Adds configurable mode list

2024-11-05 Thread Akihiko Odaki
porary array - previously done with alloca. v7: * Simplified error handling in property parsing hw/display/apple-gfx-mmio.m | 8 +++ hw/display/apple-gfx-pci.m | 9 ++- hw/display/apple-gfx.h | 12 hw/display/apple-gfx.m | 136 +++- hw/dis

Re: [PATCH v7 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-05 Thread Akihiko Odaki
ns in apple-gfx.m to group them by area of functionality. * Improved comments and tweaked some names. v7: * Use g_ptr_array_find() helper function * Error handling coding style tweak hw/display/Kconfig | 9 + hw/display/apple-gfx-mmio.m | 281 + hw/display/apple-

Re: [PATCH v6 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-05 Thread Akihiko Odaki
ch must wait for a BH to complete now >     creates an ephemeral QemuSemaphore to await completion. >   * Re-removed tracking of mapped surface manager memory regions. Just look up >     and ref/unref the memory regions in the map/unmap callbacks. >   * Re-ordered fu

[PATCH v7 03/15] hw/display/apple-gfx: Adds PCI implementation

2024-11-05 Thread Phil Dennis-Jordan
- v4: * Threading improvements analogous to those in common apple-gfx code and mmio device variant. * Smaller code review issues addressed. v5: * Minor error handling improvement. v6: * Removed an unused function parameter. hw/display/Kconfig | 4 + hw/display/apple-gfx-pci.m

[PATCH v7 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-05 Thread Phil Dennis-Jordan
tr_array_find() helper function * Error handling coding style tweak hw/display/Kconfig | 9 + hw/display/apple-gfx-mmio.m | 281 + hw/display/apple-gfx.h | 65 +++ hw/display/apple-gfx.m | 770 hw/display/meson.build |

[PATCH v7 04/15] hw/display/apple-gfx: Adds configurable mode list

2024-11-05 Thread Phil Dennis-Jordan
o been added to the -mmio variant. * Tidied up the code a little. v5: * Better error handling and buffer management in property parsing and output. v6: * Switched to using NSMutableArray for the mode list to avoid need for allocating a temporary array - previously done with alloca. v7: * Simpl

Re: [PATCH v6 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-05 Thread Phil Dennis-Jordan
t; > occurs under BQL. > > * Memory mapping operations now use RCU_READ_LOCK_GUARD() where > possible > > instead of a heavy-weight BH job to acquire the BQL. > > * Changed PVG cursor and mode setting callbacks to kick off BHs > instead of > > libdispatch

Re: [PATCH v6 04/15] hw/display/apple-gfx: Adds configurable mode list

2024-11-05 Thread Akihiko Odaki
ommand line support. * The property has also been added to the -mmio variant. * Tidied up the code a little. v5: * Better error handling and buffer management in property parsing and output. v6: * Switched to using NSMutableArray for the mode list to avoid need for allocating a tempora

Re: [PATCH v6 03/15] hw/display/apple-gfx: Adds PCI implementation

2024-11-05 Thread Akihiko Odaki
evice. Signed-off-by: Phil Dennis-Jordan --- v4: * Threading improvements analogous to those in common apple-gfx code and mmio device variant. * Smaller code review issues addressed. v5: * Minor error handling improvement. hw/display/Kconfig | 4 + hw/display/apple-gfx-

Re: [PATCH v6 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-05 Thread Akihiko Odaki
ns in apple-gfx.m to group them by area of functionality. * Improved comments and tweaked some names. hw/display/Kconfig | 9 + hw/display/apple-gfx-mmio.m | 281 + hw/display/apple-gfx.h | 65 +++ hw/display/apple-gfx.m | 773 +++

Re: [PATCH v4 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-03 Thread Phil Dennis-Jordan
> > PVGraphics.framework's libdispatch based approach and Qemu's BQL/ > > AIO/BH > > > approach, we are already sending messages to other threads very > > > frequently. This isn't ideal, but not fixable without drastically &g

[PATCH v6 04/15] hw/display/apple-gfx: Adds configurable mode list

2024-11-03 Thread Phil Dennis-Jordan
o been added to the -mmio variant. * Tidied up the code a little. v5: * Better error handling and buffer management in property parsing and output. v6: * Switched to using NSMutableArray for the mode list to avoid need for allocating a temporary array - previously done with alloca. hw/display

[PATCH v6 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-03 Thread Phil Dennis-Jordan
ait completion. * Re-removed tracking of mapped surface manager memory regions. Just look up and ref/unref the memory regions in the map/unmap callbacks. * Re-ordered functions in apple-gfx.m to group them by area of functionality. * Improved comments and tweaked some names. hw/display/Kco

[PATCH v6 03/15] hw/display/apple-gfx: Adds PCI implementation

2024-11-03 Thread Phil Dennis-Jordan
- v4: * Threading improvements analogous to those in common apple-gfx code and mmio device variant. * Smaller code review issues addressed. v5: * Minor error handling improvement. hw/display/Kconfig | 4 + hw/display/apple-gfx-pci.m | 149 + hw/di

Re: [PATCH v5 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-02 Thread Akihiko Odaki
eads being awoken unnecessarily to near zero. >   * MMIO device variant: Unified the BH job for raising interrupts. >   * Use DMA APIs for PVG framework's guest memory read requests. >   * Thread safety improvements: ensure mutable AppleGFXState fields are not

Re: [PATCH v5 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-10-31 Thread Akihiko Odaki
ted mutex for the task list. * Retain references to MemoryRegions for which there exist mappings in each PGTask, and for IOSurface mappings. hw/display/Kconfig | 9 + hw/display/apple-gfx-mmio.m | 387 ++ hw/display/apple-gfx.h |

Re: [PATCH v4 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-10-30 Thread Akihiko Odaki
ork. With multithreading, the devil is always in the detail! 😅 I wouldn't mind if we were seeing genuine issues with the Mutex/Cond code, but it's fine as far as I can tell. The QemuEvent version wasn't even really any simpler (replacing bool done; with QemuEvent done_event; and a

Re: [PATCH v4 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-10-29 Thread Phil Dennis-Jordan
On Tue, 29 Oct 2024 at 08:42, Akihiko Odaki wrote: > On 2024/10/29 6:06, Phil Dennis-Jordan wrote: > > > > > > On Mon, 28 Oct 2024 at 17:06, Akihiko Odaki > > wrote: > > > > On 2024/10/28 23:13, Phil Dennis-Jordan wrote: > > > > > > > > > On Mo

[PATCH v5 03/15] hw/display/apple-gfx: Adds PCI implementation

2024-10-29 Thread Phil Dennis-Jordan
- v4: * Threading improvements analogous to those in common apple-gfx code and mmio device variant. * Addressed some smaller issues raised in code review. v5: * Minor error handling improvement. hw/display/Kconfig | 4 + hw/display/apple-gfx-pci.m

[PATCH v5 04/15] hw/display/apple-gfx: Adds configurable mode list

2024-10-29 Thread Phil Dennis-Jordan
o been added to the -mmio variant. * Tidied up the code a little. v5: * Better error handling and buffer management in property parsing and output. hw/display/apple-gfx-mmio.m | 8 +++ hw/display/apple-gfx-pci.m | 9 ++- hw/display/apple-gfx.h | 12 hw/display/apple-gfx.m | 121 +

[PATCH v5 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-10-29 Thread Phil Dennis-Jordan
PGTask, and for IOSurface mappings. hw/display/Kconfig | 9 + hw/display/apple-gfx-mmio.m | 387 ++ hw/display/apple-gfx.h | 79 hw/display/apple-gfx.m | 773 hw/display/meson.build | 4 + hw/dis

Re: [PATCH v4 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-10-29 Thread Akihiko Odaki
On 2024/10/29 6:06, Phil Dennis-Jordan wrote: On Mon, 28 Oct 2024 at 17:06, Akihiko Odaki > wrote: On 2024/10/28 23:13, Phil Dennis-Jordan wrote: > > > On Mon, 28 Oct 2024 at 15:02, Akihiko Odaki mailto:akihiko.od...@daynix.com> > <

Re: [PATCH v4 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-10-28 Thread Phil Dennis-Jordan
On Mon, 28 Oct 2024 at 17:06, Akihiko Odaki wrote: > On 2024/10/28 23:13, Phil Dennis-Jordan wrote: > > > > > > On Mon, 28 Oct 2024 at 15:02, Akihiko Odaki > > wrote: > > > > On 2024/10/28 22:31, Phil Dennis-Jordan wrote: > > > > > > > > > On M

Re: [PATCH v4 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-10-28 Thread Akihiko Odaki
On 2024/10/28 23:13, Phil Dennis-Jordan wrote: On Mon, 28 Oct 2024 at 15:02, Akihiko Odaki > wrote: On 2024/10/28 22:31, Phil Dennis-Jordan wrote: > > > On Mon, 28 Oct 2024 at 10:00, Phil Dennis-Jordan mailto:p...@philjordan.eu> > <

Re: [PATCH v4 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-10-28 Thread Phil Dennis-Jordan
On Mon, 28 Oct 2024 at 10:00, Phil Dennis-Jordan wrote: > > > > >> > > Hmm. I think if we were to use that, we would need to create a >> new >> > > QemuEvent for every job and destroy it afterward, which seems >> > expensive. >> > > We can't rule out multiple concurrent jo

Re: [PATCH v4 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-10-28 Thread Phil Dennis-Jordan
On Mon, 28 Oct 2024 at 15:02, Akihiko Odaki wrote: > On 2024/10/28 22:31, Phil Dennis-Jordan wrote: > > > > > > On Mon, 28 Oct 2024 at 10:00, Phil Dennis-Jordan > > wrote: > > > > > > > > > > > > Hmm. I think if we were to use that, we would

Re: [PATCH v4 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-10-28 Thread Akihiko Odaki
On 2024/10/28 22:31, Phil Dennis-Jordan wrote: On Mon, 28 Oct 2024 at 10:00, Phil Dennis-Jordan > wrote: >      > >      > Hmm. I think if we were to use that, we would need to create a new >      > QemuEvent for every job and des

Re: [PATCH v4 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-10-28 Thread Akihiko Odaki
On 2024/10/26 19:24, Phil Dennis-Jordan wrote: On Sat, 26 Oct 2024 at 06:40, Akihiko Odaki > wrote: On 2024/10/26 4:43, Phil Dennis-Jordan wrote: > > > On Fri, 25 Oct 2024 at 08:03, Akihiko Odaki mailto:akihiko.od...@daynix.com> > <

Re: [PATCH v4 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-10-26 Thread Phil Dennis-Jordan
On Sat, 26 Oct 2024 at 06:40, Akihiko Odaki wrote: > On 2024/10/26 4:43, Phil Dennis-Jordan wrote: > > > > > > On Fri, 25 Oct 2024 at 08:03, Akihiko Odaki > > wrote: > > > > On 2024/10/24 19:28, Phil Dennis-Jordan wrote: > > > +/* For running PVG mem

Re: [PATCH v4 04/15] hw/display/apple-gfx: Adds configurable mode list

2024-10-25 Thread Akihiko Odaki
ommand line support. * The property has also been added to the -mmio variant. * Tidied up the code a little. hw/display/apple-gfx-mmio.m | 8 +++ hw/display/apple-gfx-pci.m | 9 ++- hw/display/apple-gfx.h | 12 hw/display/apple-gfx.m | 127 +++

Re: [PATCH v4 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-10-25 Thread Akihiko Odaki
>   * Addressed smaller code review notes such as: function naming, object type >     declarations, type names/declarations/casts, code formatting, #include >     order, over-cautious ObjC retain/release, what goes in init vs realize, >     etc. > > >

Re: [PATCH v4 03/15] hw/display/apple-gfx: Adds PCI implementation

2024-10-25 Thread Akihiko Odaki
evice. Signed-off-by: Phil Dennis-Jordan --- v4: * Threading improvements analogous to those in common apple-gfx code and mmio device variant. * Smaller code review issues addressed. hw/display/Kconfig | 4 + hw/display/apple-gfx-pci.m

Re: [PATCH v4 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-10-25 Thread Phil Dennis-Jordan
BHs on the BQL/main AIO context, awaiting > completion > > where necessary. > > * Guest frame rendering state is covered by the BQL, with only the PVG > calls > > outside the lock, and serialised on the named render_queue. > > * Simplified logic for dropping frames in

[PATCH v4 03/15] hw/display/apple-gfx: Adds PCI implementation

2024-10-25 Thread Phil Dennis-Jordan
- v4: * Threading improvements analogous to those in common apple-gfx code and mmio device variant. * Smaller code review issues addressed. hw/display/Kconfig | 4 + hw/display/apple-gfx-pci.m | 152 + hw/display/meson.build | 1 + 3 files ch

Re: [PATCH v4 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-10-24 Thread Akihiko Odaki
s, type names/declarations/casts, code formatting, #include order, over-cautious ObjC retain/release, what goes in init vs realize, etc. hw/display/Kconfig | 9 + hw/display/apple-gfx-mmio.m | 284 ++ hw/display/apple-gfx.h | 58 +

[PATCH v4 04/15] hw/display/apple-gfx: Adds configurable mode list

2024-10-24 Thread Phil Dennis-Jordan
ded to the -mmio variant. * Tidied up the code a little. hw/display/apple-gfx-mmio.m | 8 +++ hw/display/apple-gfx-pci.m | 9 ++- hw/display/apple-gfx.h | 12 hw/display/apple-gfx.m | 127 hw/display/trace-events | 2 + 5 files chan

[PATCH v4 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-10-24 Thread Phil Dennis-Jordan
C retain/release, what goes in init vs realize, etc. hw/display/Kconfig | 9 + hw/display/apple-gfx-mmio.m | 284 ++ hw/display/apple-gfx.h | 58 +++ hw/display/apple-gfx.m | 713 hw/display/meson.build | 4 + hw/display/

Re: [PATCH v3 01/14] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-10-09 Thread Phil Dennis-Jordan
On Mon, 7 Oct 2024 at 10:25, Akihiko Odaki wrote: > > > Theoretically, It should be safe to assume the callee creates > > autoreleasepool by themselves as needed in general. We have bunch of > > code to call Objective-C APIs without creating autoreleasepool in the > > caller. Prac

Re: [PATCH v3 04/14] hw/display/apple-gfx: Adds configurable mode list

2024-10-09 Thread Phil Dennis-Jordan
e) > > > > PCI variant of apple-gfx only for the moment. > > > > Signed-off-by: Phil Dennis-Jordan > > --- > > hw/display/apple-gfx-pci.m | 43 ++- > > hw/display/apple-gfx.h | 17 - > > hw/display/apple-gfx.m | 151 +++

Re: [PATCH v3 01/14] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-10-07 Thread Akihiko Odaki
On 2024/10/06 19:39, Phil Dennis-Jordan wrote: On Thu, 3 Oct 2024 at 09:09, Akihiko Odaki > wrote: On 2024/10/02 22:33, Phil Dennis-Jordan wrote: > > >      > +#include "apple-gfx.h" >      > +#include "monitor/monitor.h" >      >

  1   2   >