RE: [PATCH 1/3] drm/amdgpu/atom: fix atom_fw check

2017-07-10 Thread Deucher, Alexander
I just sent patches to fix it.  Sorry my internet service has been out all day. 
 I'm just catching up now.

Alex

From: Marek Olšák [mailto:mar...@gmail.com]
Sent: Monday, July 10, 2017 10:08 AM
To: Deucher, Alexander
Cc: Alex Deucher; amd-gfx mailing list
Subject: Re: [PATCH 1/3] drm/amdgpu/atom: fix atom_fw check

On Mon, Jul 10, 2017 at 3:49 PM, Deucher, Alexander 
<alexander.deuc...@amd.com<mailto:alexander.deuc...@amd.com>> wrote:
> -Original Message-
> From: Marek Olšák [mailto:mar...@gmail.com<mailto:mar...@gmail.com>]
> Sent: Saturday, July 08, 2017 7:08 PM
> To: Alex Deucher
> Cc: amd-gfx mailing list; Deucher, Alexander
> Subject: Re: [PATCH 1/3] drm/amdgpu/atom: fix atom_fw check
>
> Hi Alex,
>
> This commit causes that clock_crystal_freq is 0 on Raven, demoting
> OpenGL support from 4.5 to 3.2. Can I revert?

The problem is, it's just reading garbage right now.  It would be better to 
just hardcode the reference clock until I can figure out where the reference 
clock is in atomfirmware.

OK. I'll find a way to work around it in Mesa.
Marek
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 1/3] drm/amdgpu/atom: fix atom_fw check

2017-07-10 Thread Marek Olšák
On Mon, Jul 10, 2017 at 3:49 PM, Deucher, Alexander <
alexander.deuc...@amd.com> wrote:

> > -Original Message-
> > From: Marek Olšák [mailto:mar...@gmail.com]
> > Sent: Saturday, July 08, 2017 7:08 PM
> > To: Alex Deucher
> > Cc: amd-gfx mailing list; Deucher, Alexander
> > Subject: Re: [PATCH 1/3] drm/amdgpu/atom: fix atom_fw check
> >
> > Hi Alex,
> >
> > This commit causes that clock_crystal_freq is 0 on Raven, demoting
> > OpenGL support from 4.5 to 3.2. Can I revert?
>
> The problem is, it's just reading garbage right now.  It would be better
> to just hardcode the reference clock until I can figure out where the
> reference clock is in atomfirmware.
>

OK. I'll find a way to work around it in Mesa.

Marek
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


RE: [PATCH 1/3] drm/amdgpu/atom: fix atom_fw check

2017-07-10 Thread Deucher, Alexander
> -Original Message-
> From: Marek Olšák [mailto:mar...@gmail.com]
> Sent: Saturday, July 08, 2017 7:08 PM
> To: Alex Deucher
> Cc: amd-gfx mailing list; Deucher, Alexander
> Subject: Re: [PATCH 1/3] drm/amdgpu/atom: fix atom_fw check
> 
> Hi Alex,
> 
> This commit causes that clock_crystal_freq is 0 on Raven, demoting
> OpenGL support from 4.5 to 3.2. Can I revert?

The problem is, it's just reading garbage right now.  It would be better to 
just hardcode the reference clock until I can figure out where the reference 
clock is in atomfirmware.

Alex

> 
> Marek
> 
> On Wed, Jul 5, 2017 at 9:51 PM, Alex Deucher <alexdeuc...@gmail.com>
> wrote:
> > Not all vbios images seem to set the version appropriately.
> > Switch the check based on asic type instead.
> >
> > Signed-off-by: Alex Deucher <alexander.deuc...@amd.com>
> > ---
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 15 +--
> >  1 file changed, 1 insertion(+), 14 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
> > index 365e735..ea3a250 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
> > @@ -86,19 +86,6 @@ static bool check_atom_bios(uint8_t *bios, size_t
> size)
> > return false;
> >  }
> >
> > -static bool is_atom_fw(uint8_t *bios)
> > -{
> > -   uint16_t bios_header_start = bios[0x48] | (bios[0x49] << 8);
> > -   uint8_t frev = bios[bios_header_start + 2];
> > -   uint8_t crev = bios[bios_header_start + 3];
> > -
> > -   if ((frev < 3) ||
> > -   ((frev == 3) && (crev < 3)))
> > -   return false;
> > -
> > -   return true;
> > -}
> > -
> >  /* If you boot an IGP board with a discrete card as the primary,
> >   * the IGP rom is not accessible via the rom bar as the IGP rom is
> >   * part of the system bios.  On boot, the system bios puts a
> > @@ -455,6 +442,6 @@ bool amdgpu_get_bios(struct amdgpu_device
> *adev)
> > return false;
> >
> >  success:
> > -   adev->is_atom_fw = is_atom_fw(adev->bios);
> > +   adev->is_atom_fw = (adev->asic_type >= CHIP_VEGA10) ? true :
> false;
> > return true;
> >  }
> > --
> > 2.5.5
> >
> > ___
> > amd-gfx mailing list
> > amd-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 1/3] drm/amdgpu/atom: fix atom_fw check

2017-07-08 Thread Marek Olšák
Hi Alex,

This commit causes that clock_crystal_freq is 0 on Raven, demoting
OpenGL support from 4.5 to 3.2. Can I revert?

Marek

On Wed, Jul 5, 2017 at 9:51 PM, Alex Deucher  wrote:
> Not all vbios images seem to set the version appropriately.
> Switch the check based on asic type instead.
>
> Signed-off-by: Alex Deucher 
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 15 +--
>  1 file changed, 1 insertion(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
> index 365e735..ea3a250 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
> @@ -86,19 +86,6 @@ static bool check_atom_bios(uint8_t *bios, size_t size)
> return false;
>  }
>
> -static bool is_atom_fw(uint8_t *bios)
> -{
> -   uint16_t bios_header_start = bios[0x48] | (bios[0x49] << 8);
> -   uint8_t frev = bios[bios_header_start + 2];
> -   uint8_t crev = bios[bios_header_start + 3];
> -
> -   if ((frev < 3) ||
> -   ((frev == 3) && (crev < 3)))
> -   return false;
> -
> -   return true;
> -}
> -
>  /* If you boot an IGP board with a discrete card as the primary,
>   * the IGP rom is not accessible via the rom bar as the IGP rom is
>   * part of the system bios.  On boot, the system bios puts a
> @@ -455,6 +442,6 @@ bool amdgpu_get_bios(struct amdgpu_device *adev)
> return false;
>
>  success:
> -   adev->is_atom_fw = is_atom_fw(adev->bios);
> +   adev->is_atom_fw = (adev->asic_type >= CHIP_VEGA10) ? true : false;
> return true;
>  }
> --
> 2.5.5
>
> ___
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 1/3] drm/amdgpu/atom: fix atom_fw check

2017-07-06 Thread Christian König

Am 05.07.2017 um 21:51 schrieb Alex Deucher:

Not all vbios images seem to set the version appropriately.
Switch the check based on asic type instead.

Signed-off-by: Alex Deucher 
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 15 +--
  1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
index 365e735..ea3a250 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
@@ -86,19 +86,6 @@ static bool check_atom_bios(uint8_t *bios, size_t size)
return false;
  }
  
-static bool is_atom_fw(uint8_t *bios)

-{
-   uint16_t bios_header_start = bios[0x48] | (bios[0x49] << 8);
-   uint8_t frev = bios[bios_header_start + 2];
-   uint8_t crev = bios[bios_header_start + 3];
-
-   if ((frev < 3) ||
-   ((frev == 3) && (crev < 3)))
-   return false;
-
-   return true;
-}
-
  /* If you boot an IGP board with a discrete card as the primary,
   * the IGP rom is not accessible via the rom bar as the IGP rom is
   * part of the system bios.  On boot, the system bios puts a
@@ -455,6 +442,6 @@ bool amdgpu_get_bios(struct amdgpu_device *adev)
return false;
  
  success:

-   adev->is_atom_fw = is_atom_fw(adev->bios);
+   adev->is_atom_fw = (adev->asic_type >= CHIP_VEGA10) ? true : false;


The "? true : false" part looks a bit superfluous.

Apart from that the series is Acked-by: Christian König 
.


Regards,
Christian.


return true;
  }



___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH 1/3] drm/amdgpu/atom: fix atom_fw check

2017-07-05 Thread Alex Deucher
Not all vbios images seem to set the version appropriately.
Switch the check based on asic type instead.

Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 15 +--
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
index 365e735..ea3a250 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
@@ -86,19 +86,6 @@ static bool check_atom_bios(uint8_t *bios, size_t size)
return false;
 }
 
-static bool is_atom_fw(uint8_t *bios)
-{
-   uint16_t bios_header_start = bios[0x48] | (bios[0x49] << 8);
-   uint8_t frev = bios[bios_header_start + 2];
-   uint8_t crev = bios[bios_header_start + 3];
-
-   if ((frev < 3) ||
-   ((frev == 3) && (crev < 3)))
-   return false;
-
-   return true;
-}
-
 /* If you boot an IGP board with a discrete card as the primary,
  * the IGP rom is not accessible via the rom bar as the IGP rom is
  * part of the system bios.  On boot, the system bios puts a
@@ -455,6 +442,6 @@ bool amdgpu_get_bios(struct amdgpu_device *adev)
return false;
 
 success:
-   adev->is_atom_fw = is_atom_fw(adev->bios);
+   adev->is_atom_fw = (adev->asic_type >= CHIP_VEGA10) ? true : false;
return true;
 }
-- 
2.5.5

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx