mbox series

[0/2] remove DC_FP_* wrappers in dml files

Message ID 20220326202448.2046077-1-mwen@igalia.com (mailing list archive)
Headers show
Series remove DC_FP_* wrappers in dml files | expand

Message

Melissa Wen March 26, 2022, 8:24 p.m. UTC
From FPU documentation, developers must not use DC_FP_START/END in dml
files, but invoke it when calling FPU-associated functions (isolated in
dml folder). Therefore, the first patch renames dcn10_validate_bandwidth
in dml/calcs to dcn_ for generalization, declares dcn10_validate_bandwidth
in dcn10 - that calls dcn_validate_bandwidth and wraps with DC_FP_*
accordingly. The second patch removes invocations of DC_FP_* from dml
files and properly wraps FPU functions in dc code outside dml folder.

Melissa Wen (2):
  drm/amd/display: detach fpu operations from dcn10_validate_bandwidth
    in calcs
  drm/amd/display: remove DC_FP_* wrapper from dml folder

 .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 10 ++++++++--
 .../drm/amd/display/dc/dcn10/dcn10_resource.c | 16 ++++++++++++++++
 .../drm/amd/display/dc/dml/calcs/dcn_calcs.c  | 19 +------------------
 .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c  |  2 --
 .../gpu/drm/amd/display/dc/inc/dcn_calcs.h    |  2 +-
 5 files changed, 26 insertions(+), 23 deletions(-)

Comments

Rodrigo Siqueira Jordao March 30, 2022, 12:41 p.m. UTC | #1
On 2022-03-26 16:24, Melissa Wen wrote:
>  From FPU documentation, developers must not use DC_FP_START/END in dml
> files, but invoke it when calling FPU-associated functions (isolated in
> dml folder). Therefore, the first patch renames dcn10_validate_bandwidth
> in dml/calcs to dcn_ for generalization, declares dcn10_validate_bandwidth
> in dcn10 - that calls dcn_validate_bandwidth and wraps with DC_FP_*
> accordingly. The second patch removes invocations of DC_FP_* from dml
> files and properly wraps FPU functions in dc code outside dml folder.
> 
> Melissa Wen (2):
>    drm/amd/display: detach fpu operations from dcn10_validate_bandwidth
>      in calcs
>    drm/amd/display: remove DC_FP_* wrapper from dml folder
> 
>   .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 10 ++++++++--
>   .../drm/amd/display/dc/dcn10/dcn10_resource.c | 16 ++++++++++++++++
>   .../drm/amd/display/dc/dml/calcs/dcn_calcs.c  | 19 +------------------
>   .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c  |  2 --
>   .../gpu/drm/amd/display/dc/inc/dcn_calcs.h    |  2 +-
>   5 files changed, 26 insertions(+), 23 deletions(-)
> 


Hi,

Thanks a lot for your patch!

I reviewed and tested this series and lgtm. Applied to amd-staging-drm-next.

Btw, I agree with Christian. Can you try to find a way to add a 
compilation error or warning if the developer tries to add DC_FP_* 
inside DML?

Also, about the question of recursive calling to DC_FP_*, it should be 
safe if using DC_FP_*.

Thanks
Siqueira
Melissa Wen March 30, 2022, 2:15 p.m. UTC | #2
On 03/30, Rodrigo Siqueira Jordao wrote:
> 
> 
> On 2022-03-26 16:24, Melissa Wen wrote:
> >  From FPU documentation, developers must not use DC_FP_START/END in dml
> > files, but invoke it when calling FPU-associated functions (isolated in
> > dml folder). Therefore, the first patch renames dcn10_validate_bandwidth
> > in dml/calcs to dcn_ for generalization, declares dcn10_validate_bandwidth
> > in dcn10 - that calls dcn_validate_bandwidth and wraps with DC_FP_*
> > accordingly. The second patch removes invocations of DC_FP_* from dml
> > files and properly wraps FPU functions in dc code outside dml folder.
> > 
> > Melissa Wen (2):
> >    drm/amd/display: detach fpu operations from dcn10_validate_bandwidth
> >      in calcs
> >    drm/amd/display: remove DC_FP_* wrapper from dml folder
> > 
> >   .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 10 ++++++++--
> >   .../drm/amd/display/dc/dcn10/dcn10_resource.c | 16 ++++++++++++++++
> >   .../drm/amd/display/dc/dml/calcs/dcn_calcs.c  | 19 +------------------
> >   .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c  |  2 --
> >   .../gpu/drm/amd/display/dc/inc/dcn_calcs.h    |  2 +-
> >   5 files changed, 26 insertions(+), 23 deletions(-)
> > 
> 
> 
> Hi,
> 
> Thanks a lot for your patch!
> 
> I reviewed and tested this series and lgtm. Applied to amd-staging-drm-next.
> 
> Btw, I agree with Christian. Can you try to find a way to add a compilation
> error or warning if the developer tries to add DC_FP_* inside DML?

Yes, I agree too. I'll try to address it as soon as possible. 
> 
> Also, about the question of recursive calling to DC_FP_*, it should be safe
> if using DC_FP_*.

Thanks,

Melissa
> 
> Thanks
> Siqueira