[PATCH 0/4] nova-core Improve pin initializer code

Danilo Krummrich posted 4 patches 1 month, 3 weeks ago
drivers/gpu/nova-core/firmware/gsp.rs | 134 +++++++++++++-------------
drivers/gpu/nova-core/gpu.rs          |   2 +-
drivers/gpu/nova-core/gsp.rs          |  73 +++++++-------
drivers/gpu/nova-core/gsp/boot.rs     |   5 +-
4 files changed, 106 insertions(+), 108 deletions(-)
[PATCH 0/4] nova-core Improve pin initializer code
Posted by Danilo Krummrich 1 month, 3 weeks ago
This is a minor series to improve some of the pin initializer code to:

1. Reduce redundancy caused by Result<impl PinInit<T, Error>> return
values with pin_init_scope().

2. Relocate code that technically fits in the pin initializer into the
initializer itself.

While, thanks to pin_init_scope(), it is also possible to keep it as is,
moving appropriate code into the initializer has the advantage that it
structures the dependencies of fields naturally.

For instance, intermediate data that is only needed for a single field goes
into the initializer block of this field, making it obvious that it is not
needed by anything else.

On the other hand, intermediate data that is needed for multiple fields to
initialize remains above the initializer, naturally indicating that it is
needed my multiple fields.

Danilo Krummrich (4):
  gpu: nova-core: fw: get rid of redundant Result in GspFirmware::new()
  gpu: nova-core: fw: move appropriate code into pin initializer
  gpu: nova-core: gsp: get rid of redundant Result in Gsp::new()
  gpu: nova-core: gsp: move appropriate code into pin initializer

 drivers/gpu/nova-core/firmware/gsp.rs | 134 +++++++++++++-------------
 drivers/gpu/nova-core/gpu.rs          |   2 +-
 drivers/gpu/nova-core/gsp.rs          |  73 +++++++-------
 drivers/gpu/nova-core/gsp/boot.rs     |   5 +-
 4 files changed, 106 insertions(+), 108 deletions(-)


base-commit: 97cf6bc0abd381fd84e5d8e978322a62a58fb00e
-- 
2.52.0
Re: [PATCH 0/4] nova-core Improve pin initializer code
Posted by Danilo Krummrich 1 month, 1 week ago
On Thu Dec 18, 2025 at 4:50 PM CET, Danilo Krummrich wrote:
> This is a minor series to improve some of the pin initializer code to:
>
> 1. Reduce redundancy caused by Result<impl PinInit<T, Error>> return
> values with pin_init_scope().
>
> 2. Relocate code that technically fits in the pin initializer into the
> initializer itself.

Applied to drm-rust-next, thanks!
Re: [PATCH 0/4] nova-core Improve pin initializer code
Posted by Joel Fernandes 1 month, 2 weeks ago

> On Dec 18, 2025, at 10:52 AM, Danilo Krummrich <dakr@kernel.org> wrote:
> 
> This is a minor series to improve some of the pin initializer code to:
> 
> 1. Reduce redundancy caused by Result<impl PinInit<T, Error>> return
> values with pin_init_scope().
> 
> 2. Relocate code that technically fits in the pin initializer into the
> initializer itself.
> 
> While, thanks to pin_init_scope(), it is also possible to keep it as is,
> moving appropriate code into the initializer has the advantage that it
> structures the dependencies of fields naturally.
> 
> For instance, intermediate data that is only needed for a single field goes
> into the initializer block of this field, making it obvious that it is not
> needed by anything else.
> 
> On the other hand, intermediate data that is needed for multiple fields to
> initialize remains above the initializer, naturally indicating that it is
> needed my multiple fields.
> 
> Danilo Krummrich (4):
>  gpu: nova-core: fw: get rid of redundant Result in GspFirmware::new()
>  gpu: nova-core: fw: move appropriate code into pin initializer
>  gpu: nova-core: gsp: get rid of redundant Result in Gsp::new()
>  gpu: nova-core: gsp: move appropriate code into pin initializer

Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>

thanks,

 - Joel


> 
> drivers/gpu/nova-core/firmware/gsp.rs | 134 +++++++++++++-------------
> drivers/gpu/nova-core/gpu.rs          |   2 +-
> drivers/gpu/nova-core/gsp.rs          |  73 +++++++-------
> drivers/gpu/nova-core/gsp/boot.rs     |   5 +-
> 4 files changed, 106 insertions(+), 108 deletions(-)
> 
> 
> base-commit: 97cf6bc0abd381fd84e5d8e978322a62a58fb00e
> --
> 2.52.0
>