Re: [PATCH v2 04/10] drm/amd/display: dc/bios: add support for DCE6

2018-10-17 Thread Wentland, Harry
On 2018-10-17 4:42 p.m., Alex Deucher wrote:
> On Wed, Oct 17, 2018 at 4:16 PM Wentland, Harry  
> wrote:
>>
>> On 2018-10-17 4:10 p.m., Alex Deucher wrote:
>>> On Wed, Oct 17, 2018 at 3:54 PM Wentland, Harry  
>>> wrote:

 On 2018-10-17 4:35 a.m., Mauro Rossi wrote:
> DCE6 targets are added replicating existing DCE8 implementation.
> ---
>  drivers/gpu/drm/amd/display/dc/bios/Makefile  |   9 +
>  .../display/dc/bios/command_table_helper.c|   8 +
>  .../display/dc/bios/command_table_helper.h|   3 +
>  .../display/dc/bios/command_table_helper2.c   |   8 +
>  .../display/dc/bios/command_table_helper2.h   |   3 +
>  .../bios/dce60/command_table_helper_dce60.c   | 354 ++
>  .../bios/dce60/command_table_helper_dce60.h   |  33 ++
>  7 files changed, 418 insertions(+)
>  create mode 100644 
> drivers/gpu/drm/amd/display/dc/bios/dce60/command_table_helper_dce60.c
>  create mode 100644 
> drivers/gpu/drm/amd/display/dc/bios/dce60/command_table_helper_dce60.h
>
> diff --git a/drivers/gpu/drm/amd/display/dc/bios/Makefile 
> b/drivers/gpu/drm/amd/display/dc/bios/Makefile
> index 239e86bbec5a..ed6b5e9763f6 100644
> --- a/drivers/gpu/drm/amd/display/dc/bios/Makefile
> +++ b/drivers/gpu/drm/amd/display/dc/bios/Makefile
> @@ -31,6 +31,15 @@ AMD_DAL_BIOS = $(addprefix 
> $(AMDDALPATH)/dc/bios/,$(BIOS))
>
>  AMD_DISPLAY_FILES += $(AMD_DAL_BIOS)
>
> +###
> +# DCE 6x
> +###
> +# All DCE6.x are derived from DCE6.0, so 6.0 MUST be defined if ANY of
> +# DCE6.x is compiled.
> +ifdef CONFIG_DRM_AMD_DC_SI
> +AMD_DISPLAY_FILES += 
> $(AMDDALPATH)/dc/bios/dce60/command_table_helper_dce60.o
> +endif
> +
>  
> ###
>  # DCE 8x
>  
> ###
> diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c 
> b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c
> index 253bbb1eea60..48b4ef03fc8f 100644
> --- a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c
> +++ b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c
> @@ -36,6 +36,14 @@ bool dal_bios_parser_init_cmd_tbl_helper(
>   enum dce_version dce)
>  {
>   switch (dce) {
> +#if defined(CONFIG_DRM_AMD_DC_SI)
> + case DCE_VERSION_6_0:
> + case DCE_VERSION_6_1:
> + case DCE_VERSION_6_4:
> + *h = dal_cmd_tbl_helper_dce60_get_table();

 Can we just point these to the dce80 version since they're exactly the 
 same?
>>>
>>> Some of the dig transmitter and encoder cmd tables had different
>>> versions on DCE6 vs 8.  I'm not sure if we need to do any different
>>> translations for some of these.
>>>
>>
>> Currently it's an exact copy. Since you remember differences it makes sense 
>> to duplicate this for DCE6 so we can update it for any difference if we'll 
>> need that.
>>
>> Mauro, ignore my comments in this case. :)
> 
> I just double checked the vbios DCE8 design documents and the cmd
> tables are compatible (the only major difference was the addition of
> the 7th phy which won't show up on DCE6, so not an issue).  I also
> double check the cmd table versions on a few bioses and they are the
> same.  We should be fine with just sharing the DCE8 code for DCE6 as
> well.  Sorry for the noise.
> 

Thanks for looking into the design docs. Looks like we're good to share this 
code then.

Harry

> Alex
> 
>>
>> Harry
>>
>>> Alex
>>>

> + return true;
> +#endif
> +
>   case DCE_VERSION_8_0:
>   case DCE_VERSION_8_1:
>   case DCE_VERSION_8_3:
> diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h 
> b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h
> index 4c3789df253d..dfd30aaf4032 100644
> --- a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h
> +++ b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h
> @@ -26,6 +26,9 @@
>  #ifndef __DAL_COMMAND_TABLE_HELPER_H__
>  #define __DAL_COMMAND_TABLE_HELPER_H__
>
> +#if defined(CONFIG_DRM_AMD_DC_SI)
> +#include "dce60/command_table_helper_dce60.h"
> +#endif
>  #include "dce80/command_table_helper_dce80.h"
>  #include "dce110/command_table_helper_dce110.h"
>  #include "dce112/command_table_helper_dce112.h"
> diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c 
> b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c
> index 65b006ad372e..92288c582934 100644
> --- a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c
> +++ b

Re: [PATCH v2 04/10] drm/amd/display: dc/bios: add support for DCE6

2018-10-17 Thread Alex Deucher
On Wed, Oct 17, 2018 at 4:16 PM Wentland, Harry  wrote:
>
> On 2018-10-17 4:10 p.m., Alex Deucher wrote:
> > On Wed, Oct 17, 2018 at 3:54 PM Wentland, Harry  
> > wrote:
> >>
> >> On 2018-10-17 4:35 a.m., Mauro Rossi wrote:
> >>> DCE6 targets are added replicating existing DCE8 implementation.
> >>> ---
> >>>  drivers/gpu/drm/amd/display/dc/bios/Makefile  |   9 +
> >>>  .../display/dc/bios/command_table_helper.c|   8 +
> >>>  .../display/dc/bios/command_table_helper.h|   3 +
> >>>  .../display/dc/bios/command_table_helper2.c   |   8 +
> >>>  .../display/dc/bios/command_table_helper2.h   |   3 +
> >>>  .../bios/dce60/command_table_helper_dce60.c   | 354 ++
> >>>  .../bios/dce60/command_table_helper_dce60.h   |  33 ++
> >>>  7 files changed, 418 insertions(+)
> >>>  create mode 100644 
> >>> drivers/gpu/drm/amd/display/dc/bios/dce60/command_table_helper_dce60.c
> >>>  create mode 100644 
> >>> drivers/gpu/drm/amd/display/dc/bios/dce60/command_table_helper_dce60.h
> >>>
> >>> diff --git a/drivers/gpu/drm/amd/display/dc/bios/Makefile 
> >>> b/drivers/gpu/drm/amd/display/dc/bios/Makefile
> >>> index 239e86bbec5a..ed6b5e9763f6 100644
> >>> --- a/drivers/gpu/drm/amd/display/dc/bios/Makefile
> >>> +++ b/drivers/gpu/drm/amd/display/dc/bios/Makefile
> >>> @@ -31,6 +31,15 @@ AMD_DAL_BIOS = $(addprefix 
> >>> $(AMDDALPATH)/dc/bios/,$(BIOS))
> >>>
> >>>  AMD_DISPLAY_FILES += $(AMD_DAL_BIOS)
> >>>
> >>> +###
> >>> +# DCE 6x
> >>> +###
> >>> +# All DCE6.x are derived from DCE6.0, so 6.0 MUST be defined if ANY of
> >>> +# DCE6.x is compiled.
> >>> +ifdef CONFIG_DRM_AMD_DC_SI
> >>> +AMD_DISPLAY_FILES += 
> >>> $(AMDDALPATH)/dc/bios/dce60/command_table_helper_dce60.o
> >>> +endif
> >>> +
> >>>  
> >>> ###
> >>>  # DCE 8x
> >>>  
> >>> ###
> >>> diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c 
> >>> b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c
> >>> index 253bbb1eea60..48b4ef03fc8f 100644
> >>> --- a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c
> >>> +++ b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c
> >>> @@ -36,6 +36,14 @@ bool dal_bios_parser_init_cmd_tbl_helper(
> >>>   enum dce_version dce)
> >>>  {
> >>>   switch (dce) {
> >>> +#if defined(CONFIG_DRM_AMD_DC_SI)
> >>> + case DCE_VERSION_6_0:
> >>> + case DCE_VERSION_6_1:
> >>> + case DCE_VERSION_6_4:
> >>> + *h = dal_cmd_tbl_helper_dce60_get_table();
> >>
> >> Can we just point these to the dce80 version since they're exactly the 
> >> same?
> >
> > Some of the dig transmitter and encoder cmd tables had different
> > versions on DCE6 vs 8.  I'm not sure if we need to do any different
> > translations for some of these.
> >
>
> Currently it's an exact copy. Since you remember differences it makes sense 
> to duplicate this for DCE6 so we can update it for any difference if we'll 
> need that.
>
> Mauro, ignore my comments in this case. :)

I just double checked the vbios DCE8 design documents and the cmd
tables are compatible (the only major difference was the addition of
the 7th phy which won't show up on DCE6, so not an issue).  I also
double check the cmd table versions on a few bioses and they are the
same.  We should be fine with just sharing the DCE8 code for DCE6 as
well.  Sorry for the noise.

Alex

>
> Harry
>
> > Alex
> >
> >>
> >>> + return true;
> >>> +#endif
> >>> +
> >>>   case DCE_VERSION_8_0:
> >>>   case DCE_VERSION_8_1:
> >>>   case DCE_VERSION_8_3:
> >>> diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h 
> >>> b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h
> >>> index 4c3789df253d..dfd30aaf4032 100644
> >>> --- a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h
> >>> +++ b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h
> >>> @@ -26,6 +26,9 @@
> >>>  #ifndef __DAL_COMMAND_TABLE_HELPER_H__
> >>>  #define __DAL_COMMAND_TABLE_HELPER_H__
> >>>
> >>> +#if defined(CONFIG_DRM_AMD_DC_SI)
> >>> +#include "dce60/command_table_helper_dce60.h"
> >>> +#endif
> >>>  #include "dce80/command_table_helper_dce80.h"
> >>>  #include "dce110/command_table_helper_dce110.h"
> >>>  #include "dce112/command_table_helper_dce112.h"
> >>> diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c 
> >>> b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c
> >>> index 65b006ad372e..92288c582934 100644
> >>> --- a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c
> >>> +++ b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c
> >>> @@ -37,6 +37,14 @@ bool dal_bios_parser_init_cmd_tbl_helper2(
> >>>   enum dce_version dce)
> >>>  {
> >>>  

Re: [PATCH v2 04/10] drm/amd/display: dc/bios: add support for DCE6

2018-10-17 Thread Wentland, Harry
On 2018-10-17 4:10 p.m., Alex Deucher wrote:
> On Wed, Oct 17, 2018 at 3:54 PM Wentland, Harry  
> wrote:
>>
>> On 2018-10-17 4:35 a.m., Mauro Rossi wrote:
>>> DCE6 targets are added replicating existing DCE8 implementation.
>>> ---
>>>  drivers/gpu/drm/amd/display/dc/bios/Makefile  |   9 +
>>>  .../display/dc/bios/command_table_helper.c|   8 +
>>>  .../display/dc/bios/command_table_helper.h|   3 +
>>>  .../display/dc/bios/command_table_helper2.c   |   8 +
>>>  .../display/dc/bios/command_table_helper2.h   |   3 +
>>>  .../bios/dce60/command_table_helper_dce60.c   | 354 ++
>>>  .../bios/dce60/command_table_helper_dce60.h   |  33 ++
>>>  7 files changed, 418 insertions(+)
>>>  create mode 100644 
>>> drivers/gpu/drm/amd/display/dc/bios/dce60/command_table_helper_dce60.c
>>>  create mode 100644 
>>> drivers/gpu/drm/amd/display/dc/bios/dce60/command_table_helper_dce60.h
>>>
>>> diff --git a/drivers/gpu/drm/amd/display/dc/bios/Makefile 
>>> b/drivers/gpu/drm/amd/display/dc/bios/Makefile
>>> index 239e86bbec5a..ed6b5e9763f6 100644
>>> --- a/drivers/gpu/drm/amd/display/dc/bios/Makefile
>>> +++ b/drivers/gpu/drm/amd/display/dc/bios/Makefile
>>> @@ -31,6 +31,15 @@ AMD_DAL_BIOS = $(addprefix 
>>> $(AMDDALPATH)/dc/bios/,$(BIOS))
>>>
>>>  AMD_DISPLAY_FILES += $(AMD_DAL_BIOS)
>>>
>>> +###
>>> +# DCE 6x
>>> +###
>>> +# All DCE6.x are derived from DCE6.0, so 6.0 MUST be defined if ANY of
>>> +# DCE6.x is compiled.
>>> +ifdef CONFIG_DRM_AMD_DC_SI
>>> +AMD_DISPLAY_FILES += 
>>> $(AMDDALPATH)/dc/bios/dce60/command_table_helper_dce60.o
>>> +endif
>>> +
>>>  
>>> ###
>>>  # DCE 8x
>>>  
>>> ###
>>> diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c 
>>> b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c
>>> index 253bbb1eea60..48b4ef03fc8f 100644
>>> --- a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c
>>> +++ b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c
>>> @@ -36,6 +36,14 @@ bool dal_bios_parser_init_cmd_tbl_helper(
>>>   enum dce_version dce)
>>>  {
>>>   switch (dce) {
>>> +#if defined(CONFIG_DRM_AMD_DC_SI)
>>> + case DCE_VERSION_6_0:
>>> + case DCE_VERSION_6_1:
>>> + case DCE_VERSION_6_4:
>>> + *h = dal_cmd_tbl_helper_dce60_get_table();
>>
>> Can we just point these to the dce80 version since they're exactly the same?
> 
> Some of the dig transmitter and encoder cmd tables had different
> versions on DCE6 vs 8.  I'm not sure if we need to do any different
> translations for some of these.
> 

Currently it's an exact copy. Since you remember differences it makes sense to 
duplicate this for DCE6 so we can update it for any difference if we'll need 
that.

Mauro, ignore my comments in this case. :)

Harry

> Alex
> 
>>
>>> + return true;
>>> +#endif
>>> +
>>>   case DCE_VERSION_8_0:
>>>   case DCE_VERSION_8_1:
>>>   case DCE_VERSION_8_3:
>>> diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h 
>>> b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h
>>> index 4c3789df253d..dfd30aaf4032 100644
>>> --- a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h
>>> +++ b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h
>>> @@ -26,6 +26,9 @@
>>>  #ifndef __DAL_COMMAND_TABLE_HELPER_H__
>>>  #define __DAL_COMMAND_TABLE_HELPER_H__
>>>
>>> +#if defined(CONFIG_DRM_AMD_DC_SI)
>>> +#include "dce60/command_table_helper_dce60.h"
>>> +#endif
>>>  #include "dce80/command_table_helper_dce80.h"
>>>  #include "dce110/command_table_helper_dce110.h"
>>>  #include "dce112/command_table_helper_dce112.h"
>>> diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c 
>>> b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c
>>> index 65b006ad372e..92288c582934 100644
>>> --- a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c
>>> +++ b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c
>>> @@ -37,6 +37,14 @@ bool dal_bios_parser_init_cmd_tbl_helper2(
>>>   enum dce_version dce)
>>>  {
>>>   switch (dce) {
>>> +#if defined(CONFIG_DRM_AMD_DC_SI)
>>> + case DCE_VERSION_6_0:
>>> + case DCE_VERSION_6_1:
>>> + case DCE_VERSION_6_4:
>>> + *h = dal_cmd_tbl_helper_dce60_get_table();
>>
>> Same as above.
>>
>> Harry
>>
>>> + return true;
>>> +#endif
>>> +
>>>   case DCE_VERSION_8_0:
>>>   case DCE_VERSION_8_1:
>>>   case DCE_VERSION_8_3:
>>> diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.h 
>>> b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.h
>>> index 785fcb20a1b9..66e0a3e73768 100644
>>> --- a/drivers/gpu/drm/amd/display/dc/bios/command_table_help

Re: [PATCH v2 04/10] drm/amd/display: dc/bios: add support for DCE6

2018-10-17 Thread Alex Deucher
On Wed, Oct 17, 2018 at 3:54 PM Wentland, Harry  wrote:
>
> On 2018-10-17 4:35 a.m., Mauro Rossi wrote:
> > DCE6 targets are added replicating existing DCE8 implementation.
> > ---
> >  drivers/gpu/drm/amd/display/dc/bios/Makefile  |   9 +
> >  .../display/dc/bios/command_table_helper.c|   8 +
> >  .../display/dc/bios/command_table_helper.h|   3 +
> >  .../display/dc/bios/command_table_helper2.c   |   8 +
> >  .../display/dc/bios/command_table_helper2.h   |   3 +
> >  .../bios/dce60/command_table_helper_dce60.c   | 354 ++
> >  .../bios/dce60/command_table_helper_dce60.h   |  33 ++
> >  7 files changed, 418 insertions(+)
> >  create mode 100644 
> > drivers/gpu/drm/amd/display/dc/bios/dce60/command_table_helper_dce60.c
> >  create mode 100644 
> > drivers/gpu/drm/amd/display/dc/bios/dce60/command_table_helper_dce60.h
> >
> > diff --git a/drivers/gpu/drm/amd/display/dc/bios/Makefile 
> > b/drivers/gpu/drm/amd/display/dc/bios/Makefile
> > index 239e86bbec5a..ed6b5e9763f6 100644
> > --- a/drivers/gpu/drm/amd/display/dc/bios/Makefile
> > +++ b/drivers/gpu/drm/amd/display/dc/bios/Makefile
> > @@ -31,6 +31,15 @@ AMD_DAL_BIOS = $(addprefix 
> > $(AMDDALPATH)/dc/bios/,$(BIOS))
> >
> >  AMD_DISPLAY_FILES += $(AMD_DAL_BIOS)
> >
> > +###
> > +# DCE 6x
> > +###
> > +# All DCE6.x are derived from DCE6.0, so 6.0 MUST be defined if ANY of
> > +# DCE6.x is compiled.
> > +ifdef CONFIG_DRM_AMD_DC_SI
> > +AMD_DISPLAY_FILES += 
> > $(AMDDALPATH)/dc/bios/dce60/command_table_helper_dce60.o
> > +endif
> > +
> >  
> > ###
> >  # DCE 8x
> >  
> > ###
> > diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c 
> > b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c
> > index 253bbb1eea60..48b4ef03fc8f 100644
> > --- a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c
> > +++ b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c
> > @@ -36,6 +36,14 @@ bool dal_bios_parser_init_cmd_tbl_helper(
> >   enum dce_version dce)
> >  {
> >   switch (dce) {
> > +#if defined(CONFIG_DRM_AMD_DC_SI)
> > + case DCE_VERSION_6_0:
> > + case DCE_VERSION_6_1:
> > + case DCE_VERSION_6_4:
> > + *h = dal_cmd_tbl_helper_dce60_get_table();
>
> Can we just point these to the dce80 version since they're exactly the same?

Some of the dig transmitter and encoder cmd tables had different
versions on DCE6 vs 8.  I'm not sure if we need to do any different
translations for some of these.

Alex

>
> > + return true;
> > +#endif
> > +
> >   case DCE_VERSION_8_0:
> >   case DCE_VERSION_8_1:
> >   case DCE_VERSION_8_3:
> > diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h 
> > b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h
> > index 4c3789df253d..dfd30aaf4032 100644
> > --- a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h
> > +++ b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h
> > @@ -26,6 +26,9 @@
> >  #ifndef __DAL_COMMAND_TABLE_HELPER_H__
> >  #define __DAL_COMMAND_TABLE_HELPER_H__
> >
> > +#if defined(CONFIG_DRM_AMD_DC_SI)
> > +#include "dce60/command_table_helper_dce60.h"
> > +#endif
> >  #include "dce80/command_table_helper_dce80.h"
> >  #include "dce110/command_table_helper_dce110.h"
> >  #include "dce112/command_table_helper_dce112.h"
> > diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c 
> > b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c
> > index 65b006ad372e..92288c582934 100644
> > --- a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c
> > +++ b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c
> > @@ -37,6 +37,14 @@ bool dal_bios_parser_init_cmd_tbl_helper2(
> >   enum dce_version dce)
> >  {
> >   switch (dce) {
> > +#if defined(CONFIG_DRM_AMD_DC_SI)
> > + case DCE_VERSION_6_0:
> > + case DCE_VERSION_6_1:
> > + case DCE_VERSION_6_4:
> > + *h = dal_cmd_tbl_helper_dce60_get_table();
>
> Same as above.
>
> Harry
>
> > + return true;
> > +#endif
> > +
> >   case DCE_VERSION_8_0:
> >   case DCE_VERSION_8_1:
> >   case DCE_VERSION_8_3:
> > diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.h 
> > b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.h
> > index 785fcb20a1b9..66e0a3e73768 100644
> > --- a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.h
> > +++ b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.h
> > @@ -26,6 +26,9 @@
> >  #ifndef __DAL_COMMAND_TABLE_HELPER2_H__
> >  #define __DAL_COMMAND_TABLE_HELPER2_H__
> >
> > +#if defined(CONFIG_DRM_AMD_DC_SI)
> > +#include "dce60/command_table_helper_dce60.h"
> > +#end

Re: [PATCH v2 04/10] drm/amd/display: dc/bios: add support for DCE6

2018-10-17 Thread Wentland, Harry
On 2018-10-17 4:35 a.m., Mauro Rossi wrote:
> DCE6 targets are added replicating existing DCE8 implementation.
> ---
>  drivers/gpu/drm/amd/display/dc/bios/Makefile  |   9 +
>  .../display/dc/bios/command_table_helper.c|   8 +
>  .../display/dc/bios/command_table_helper.h|   3 +
>  .../display/dc/bios/command_table_helper2.c   |   8 +
>  .../display/dc/bios/command_table_helper2.h   |   3 +
>  .../bios/dce60/command_table_helper_dce60.c   | 354 ++
>  .../bios/dce60/command_table_helper_dce60.h   |  33 ++
>  7 files changed, 418 insertions(+)
>  create mode 100644 
> drivers/gpu/drm/amd/display/dc/bios/dce60/command_table_helper_dce60.c
>  create mode 100644 
> drivers/gpu/drm/amd/display/dc/bios/dce60/command_table_helper_dce60.h
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/bios/Makefile 
> b/drivers/gpu/drm/amd/display/dc/bios/Makefile
> index 239e86bbec5a..ed6b5e9763f6 100644
> --- a/drivers/gpu/drm/amd/display/dc/bios/Makefile
> +++ b/drivers/gpu/drm/amd/display/dc/bios/Makefile
> @@ -31,6 +31,15 @@ AMD_DAL_BIOS = $(addprefix $(AMDDALPATH)/dc/bios/,$(BIOS))
>  
>  AMD_DISPLAY_FILES += $(AMD_DAL_BIOS)
>  
> +###
> +# DCE 6x
> +###
> +# All DCE6.x are derived from DCE6.0, so 6.0 MUST be defined if ANY of
> +# DCE6.x is compiled.
> +ifdef CONFIG_DRM_AMD_DC_SI
> +AMD_DISPLAY_FILES += $(AMDDALPATH)/dc/bios/dce60/command_table_helper_dce60.o
> +endif
> +
>  
> ###
>  # DCE 8x
>  
> ###
> diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c 
> b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c
> index 253bbb1eea60..48b4ef03fc8f 100644
> --- a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c
> +++ b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c
> @@ -36,6 +36,14 @@ bool dal_bios_parser_init_cmd_tbl_helper(
>   enum dce_version dce)
>  {
>   switch (dce) {
> +#if defined(CONFIG_DRM_AMD_DC_SI)
> + case DCE_VERSION_6_0:
> + case DCE_VERSION_6_1:
> + case DCE_VERSION_6_4:
> + *h = dal_cmd_tbl_helper_dce60_get_table();

Can we just point these to the dce80 version since they're exactly the same?

> + return true;
> +#endif
> +
>   case DCE_VERSION_8_0:
>   case DCE_VERSION_8_1:
>   case DCE_VERSION_8_3:
> diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h 
> b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h
> index 4c3789df253d..dfd30aaf4032 100644
> --- a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h
> +++ b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h
> @@ -26,6 +26,9 @@
>  #ifndef __DAL_COMMAND_TABLE_HELPER_H__
>  #define __DAL_COMMAND_TABLE_HELPER_H__
>  
> +#if defined(CONFIG_DRM_AMD_DC_SI)
> +#include "dce60/command_table_helper_dce60.h"
> +#endif
>  #include "dce80/command_table_helper_dce80.h"
>  #include "dce110/command_table_helper_dce110.h"
>  #include "dce112/command_table_helper_dce112.h"
> diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c 
> b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c
> index 65b006ad372e..92288c582934 100644
> --- a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c
> +++ b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c
> @@ -37,6 +37,14 @@ bool dal_bios_parser_init_cmd_tbl_helper2(
>   enum dce_version dce)
>  {
>   switch (dce) {
> +#if defined(CONFIG_DRM_AMD_DC_SI)
> + case DCE_VERSION_6_0:
> + case DCE_VERSION_6_1:
> + case DCE_VERSION_6_4:
> + *h = dal_cmd_tbl_helper_dce60_get_table();

Same as above.

Harry

> + return true;
> +#endif
> +
>   case DCE_VERSION_8_0:
>   case DCE_VERSION_8_1:
>   case DCE_VERSION_8_3:
> diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.h 
> b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.h
> index 785fcb20a1b9..66e0a3e73768 100644
> --- a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.h
> +++ b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.h
> @@ -26,6 +26,9 @@
>  #ifndef __DAL_COMMAND_TABLE_HELPER2_H__
>  #define __DAL_COMMAND_TABLE_HELPER2_H__
>  
> +#if defined(CONFIG_DRM_AMD_DC_SI)
> +#include "dce60/command_table_helper_dce60.h"
> +#endif
>  #include "dce80/command_table_helper_dce80.h"
>  #include "dce110/command_table_helper_dce110.h"
>  #include "dce112/command_table_helper2_dce112.h"
> diff --git 
> a/drivers/gpu/drm/amd/display/dc/bios/dce60/command_table_helper_dce60.c 
> b/drivers/gpu/drm/amd/display/dc/bios/dce60/command_table_helper_dce60.c
> new file mode 100644
> index ..552778ce9835
> --- /dev/null
> +++ b/drivers/gpu/drm/amd/display/dc/bios/dce60/command_tab

[PATCH v2 04/10] drm/amd/display: dc/bios: add support for DCE6

2018-10-17 Thread Mauro Rossi
DCE6 targets are added replicating existing DCE8 implementation.
---
 drivers/gpu/drm/amd/display/dc/bios/Makefile  |   9 +
 .../display/dc/bios/command_table_helper.c|   8 +
 .../display/dc/bios/command_table_helper.h|   3 +
 .../display/dc/bios/command_table_helper2.c   |   8 +
 .../display/dc/bios/command_table_helper2.h   |   3 +
 .../bios/dce60/command_table_helper_dce60.c   | 354 ++
 .../bios/dce60/command_table_helper_dce60.h   |  33 ++
 7 files changed, 418 insertions(+)
 create mode 100644 
drivers/gpu/drm/amd/display/dc/bios/dce60/command_table_helper_dce60.c
 create mode 100644 
drivers/gpu/drm/amd/display/dc/bios/dce60/command_table_helper_dce60.h

diff --git a/drivers/gpu/drm/amd/display/dc/bios/Makefile 
b/drivers/gpu/drm/amd/display/dc/bios/Makefile
index 239e86bbec5a..ed6b5e9763f6 100644
--- a/drivers/gpu/drm/amd/display/dc/bios/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/bios/Makefile
@@ -31,6 +31,15 @@ AMD_DAL_BIOS = $(addprefix $(AMDDALPATH)/dc/bios/,$(BIOS))
 
 AMD_DISPLAY_FILES += $(AMD_DAL_BIOS)
 
+###
+# DCE 6x
+###
+# All DCE6.x are derived from DCE6.0, so 6.0 MUST be defined if ANY of
+# DCE6.x is compiled.
+ifdef CONFIG_DRM_AMD_DC_SI
+AMD_DISPLAY_FILES += $(AMDDALPATH)/dc/bios/dce60/command_table_helper_dce60.o
+endif
+
 ###
 # DCE 8x
 ###
diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c 
b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c
index 253bbb1eea60..48b4ef03fc8f 100644
--- a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c
+++ b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c
@@ -36,6 +36,14 @@ bool dal_bios_parser_init_cmd_tbl_helper(
enum dce_version dce)
 {
switch (dce) {
+#if defined(CONFIG_DRM_AMD_DC_SI)
+   case DCE_VERSION_6_0:
+   case DCE_VERSION_6_1:
+   case DCE_VERSION_6_4:
+   *h = dal_cmd_tbl_helper_dce60_get_table();
+   return true;
+#endif
+
case DCE_VERSION_8_0:
case DCE_VERSION_8_1:
case DCE_VERSION_8_3:
diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h 
b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h
index 4c3789df253d..dfd30aaf4032 100644
--- a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h
+++ b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h
@@ -26,6 +26,9 @@
 #ifndef __DAL_COMMAND_TABLE_HELPER_H__
 #define __DAL_COMMAND_TABLE_HELPER_H__
 
+#if defined(CONFIG_DRM_AMD_DC_SI)
+#include "dce60/command_table_helper_dce60.h"
+#endif
 #include "dce80/command_table_helper_dce80.h"
 #include "dce110/command_table_helper_dce110.h"
 #include "dce112/command_table_helper_dce112.h"
diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c 
b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c
index 65b006ad372e..92288c582934 100644
--- a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c
+++ b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c
@@ -37,6 +37,14 @@ bool dal_bios_parser_init_cmd_tbl_helper2(
enum dce_version dce)
 {
switch (dce) {
+#if defined(CONFIG_DRM_AMD_DC_SI)
+   case DCE_VERSION_6_0:
+   case DCE_VERSION_6_1:
+   case DCE_VERSION_6_4:
+   *h = dal_cmd_tbl_helper_dce60_get_table();
+   return true;
+#endif
+
case DCE_VERSION_8_0:
case DCE_VERSION_8_1:
case DCE_VERSION_8_3:
diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.h 
b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.h
index 785fcb20a1b9..66e0a3e73768 100644
--- a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.h
+++ b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.h
@@ -26,6 +26,9 @@
 #ifndef __DAL_COMMAND_TABLE_HELPER2_H__
 #define __DAL_COMMAND_TABLE_HELPER2_H__
 
+#if defined(CONFIG_DRM_AMD_DC_SI)
+#include "dce60/command_table_helper_dce60.h"
+#endif
 #include "dce80/command_table_helper_dce80.h"
 #include "dce110/command_table_helper_dce110.h"
 #include "dce112/command_table_helper2_dce112.h"
diff --git 
a/drivers/gpu/drm/amd/display/dc/bios/dce60/command_table_helper_dce60.c 
b/drivers/gpu/drm/amd/display/dc/bios/dce60/command_table_helper_dce60.c
new file mode 100644
index ..552778ce9835
--- /dev/null
+++ b/drivers/gpu/drm/amd/display/dc/bios/dce60/command_table_helper_dce60.c
@@ -0,0 +1,354 @@
+/*
+ * Copyright 2012-15 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rig