[PATCH 0/6] arm/stellaris: convert gamepad input device to qdev

Peter Maydell posted 6 patches 7 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20231017122302.1692902-1-peter.maydell@linaro.org
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <eduardo@habkost.net>
There is a newer version of this series
include/hw/input/gamepad.h           |  18 -----
include/hw/input/stellaris_gamepad.h |  39 ++++++++++
include/hw/qdev-properties.h         |   3 +
hw/arm/stellaris.c                   |  34 ++++++---
hw/core/qdev-properties.c            |  21 ++++++
hw/input/stellaris_gamepad.c         | 102 +++++++++++++++++++++++++++
hw/input/stellaris_input.c           |  93 ------------------------
hw/arm/Kconfig                       |   2 +-
hw/input/Kconfig                     |   2 +-
hw/input/meson.build                 |   2 +-
10 files changed, 193 insertions(+), 123 deletions(-)
delete mode 100644 include/hw/input/gamepad.h
create mode 100644 include/hw/input/stellaris_gamepad.h
create mode 100644 hw/input/stellaris_gamepad.c
delete mode 100644 hw/input/stellaris_input.c
[PATCH 0/6] arm/stellaris: convert gamepad input device to qdev
Posted by Peter Maydell 7 months ago
(I had this all ready to go before I went off on holiday two
weeks ago, except I forgot to actually *send* the emails...)

This patchseries converts the stellaris board's gamepad input device
to qdev. This isn't a very important bit of conversion (I was just
looking for a small tail-end-of-the-week task), but it does reduce by
one the number of users of a couple of legacy APIs: vmstate_register()
and qemu_add_kbd_event_handler().

I've included Kevin's qdev_prop_set_array() patch here, because I
wanted an array property and it doesn't seem sensible to write it the
old way and have another thing that needs converting. I'm assuming
that by the time this patchset gets reviewed and committed that
one will already be upstream.

thanks
-- PMM

Kevin Wolf (1):
  qdev: Add qdev_prop_set_array()

Peter Maydell (5):
  hw/input/stellaris_input: Rename to stellaris_gamepad
  hw/input/stellaris_gamepad: Rename structs to our usual convention
  hw/input/stellaris_gamepad: Remove StellarisGamepadButton struct
  hw/input/stellaris_input: Convert to qdev
  hw/input/stellaris_gamepad: Convert to qemu_input_handler_register()

 include/hw/input/gamepad.h           |  18 -----
 include/hw/input/stellaris_gamepad.h |  39 ++++++++++
 include/hw/qdev-properties.h         |   3 +
 hw/arm/stellaris.c                   |  34 ++++++---
 hw/core/qdev-properties.c            |  21 ++++++
 hw/input/stellaris_gamepad.c         | 102 +++++++++++++++++++++++++++
 hw/input/stellaris_input.c           |  93 ------------------------
 hw/arm/Kconfig                       |   2 +-
 hw/input/Kconfig                     |   2 +-
 hw/input/meson.build                 |   2 +-
 10 files changed, 193 insertions(+), 123 deletions(-)
 delete mode 100644 include/hw/input/gamepad.h
 create mode 100644 include/hw/input/stellaris_gamepad.h
 create mode 100644 hw/input/stellaris_gamepad.c
 delete mode 100644 hw/input/stellaris_input.c

-- 
2.34.1
Re: [PATCH 0/6] arm/stellaris: convert gamepad input device to qdev
Posted by Philippe Mathieu-Daudé 6 months, 3 weeks ago
On 17/10/23 14:22, Peter Maydell wrote:
> (I had this all ready to go before I went off on holiday two
> weeks ago, except I forgot to actually *send* the emails...)
> 
> This patchseries converts the stellaris board's gamepad input device
> to qdev. This isn't a very important bit of conversion (I was just
> looking for a small tail-end-of-the-week task), but it does reduce by
> one the number of users of a couple of legacy APIs: vmstate_register()
> and qemu_add_kbd_event_handler().
> 
> I've included Kevin's qdev_prop_set_array() patch here, because I
> wanted an array property and it doesn't seem sensible to write it the
> old way and have another thing that needs converting. I'm assuming
> that by the time this patchset gets reviewed and committed that
> one will already be upstream.
> 
> thanks
> -- PMM
> 
> Kevin Wolf (1):
>    qdev: Add qdev_prop_set_array()
> 
> Peter Maydell (5):
>    hw/input/stellaris_input: Rename to stellaris_gamepad
>    hw/input/stellaris_gamepad: Rename structs to our usual convention
>    hw/input/stellaris_gamepad: Remove StellarisGamepadButton struct
>    hw/input/stellaris_input: Convert to qdev
>    hw/input/stellaris_gamepad: Convert to qemu_input_handler_register()

Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>


Re: [PATCH 0/6] arm/stellaris: convert gamepad input device to qdev
Posted by Peter Maydell 6 months, 3 weeks ago
On Mon, 30 Oct 2023 at 10:39, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> On 17/10/23 14:22, Peter Maydell wrote:
> > (I had this all ready to go before I went off on holiday two
> > weeks ago, except I forgot to actually *send* the emails...)
> >
> > This patchseries converts the stellaris board's gamepad input device
> > to qdev. This isn't a very important bit of conversion (I was just
> > looking for a small tail-end-of-the-week task), but it does reduce by
> > one the number of users of a couple of legacy APIs: vmstate_register()
> > and qemu_add_kbd_event_handler().
> >
> > I've included Kevin's qdev_prop_set_array() patch here, because I
> > wanted an array property and it doesn't seem sensible to write it the
> > old way and have another thing that needs converting. I'm assuming
> > that by the time this patchset gets reviewed and committed that
> > one will already be upstream.
> >
> > thanks
> > -- PMM
> >
> > Kevin Wolf (1):
> >    qdev: Add qdev_prop_set_array()
> >
> > Peter Maydell (5):
> >    hw/input/stellaris_input: Rename to stellaris_gamepad
> >    hw/input/stellaris_gamepad: Rename structs to our usual convention
> >    hw/input/stellaris_gamepad: Remove StellarisGamepadButton struct
> >    hw/input/stellaris_input: Convert to qdev
> >    hw/input/stellaris_gamepad: Convert to qemu_input_handler_register()
>
> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Thanks. I actually have a v2 of this ready but am waiting on a decision
about whether the qdev_prop_set_array() API is OK before I send it.

-- PMM
Re: [PATCH 0/6] arm/stellaris: convert gamepad input device to qdev
Posted by Philippe Mathieu-Daudé 6 months, 3 weeks ago
On 30/10/23 12:29, Peter Maydell wrote:
> On Mon, 30 Oct 2023 at 10:39, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>>
>> On 17/10/23 14:22, Peter Maydell wrote:
>>> (I had this all ready to go before I went off on holiday two
>>> weeks ago, except I forgot to actually *send* the emails...)
>>>
>>> This patchseries converts the stellaris board's gamepad input device
>>> to qdev. This isn't a very important bit of conversion (I was just
>>> looking for a small tail-end-of-the-week task), but it does reduce by
>>> one the number of users of a couple of legacy APIs: vmstate_register()
>>> and qemu_add_kbd_event_handler().
>>>
>>> I've included Kevin's qdev_prop_set_array() patch here, because I
>>> wanted an array property and it doesn't seem sensible to write it the
>>> old way and have another thing that needs converting. I'm assuming
>>> that by the time this patchset gets reviewed and committed that
>>> one will already be upstream.
>>>
>>> thanks
>>> -- PMM
>>>
>>> Kevin Wolf (1):
>>>     qdev: Add qdev_prop_set_array()
>>>
>>> Peter Maydell (5):
>>>     hw/input/stellaris_input: Rename to stellaris_gamepad
>>>     hw/input/stellaris_gamepad: Rename structs to our usual convention
>>>     hw/input/stellaris_gamepad: Remove StellarisGamepadButton struct
>>>     hw/input/stellaris_input: Convert to qdev
>>>     hw/input/stellaris_gamepad: Convert to qemu_input_handler_register()
>>
>> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> 
> Thanks. I actually have a v2 of this ready but am waiting on a decision
> about whether the qdev_prop_set_array() API is OK before I send it.

Oh we just crossed then :)

I'm happy with qdev_prop_set_array() for our needs but I don't think
you are waiting for my particular input there, rather Kevin / Markus.