[PATCH] drm/amd/pm: support runtime PPTable update for dimgrey_cavefish

2020-11-16 Thread Tao Zhou
There is no need to reset DPM for PPTable uploading on
dimgrey_cavefish and PMFW can handle it, same as navy_flounder.

Signed-off-by: Tao Zhou 
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c 
b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index 1904df5a3e20..8e3e7a5bbffe 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -1183,7 +1183,7 @@ static int smu_disable_dpms(struct smu_context *smu)
 */
if (smu->uploading_custom_pp_table &&
(adev->asic_type >= CHIP_NAVI10) &&
-   (adev->asic_type <= CHIP_NAVY_FLOUNDER))
+   (adev->asic_type <= CHIP_DIMGREY_CAVEFISH))
return 0;
 
/*
-- 
2.17.1

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


RE: [PATCH] drm/amd/pm: retire dimgrey_cavefish hardcode for the use of soft PTable

2020-11-16 Thread Chen, Jiansong (Simon)
[AMD Official Use Only - Internal Distribution Only]

In the subject Ptable->pptable, except that,
Reviewed-by: Jiansong Chen 

-Original Message-
From: Zhou1, Tao 
Sent: Tuesday, November 17, 2020 11:32 AM
To: Chen, Jiansong (Simon) ; Gui, Jack 
; Zhang, Hawking ; 
amd-gfx@lists.freedesktop.org
Cc: Zhou1, Tao 
Subject: [PATCH] drm/amd/pm: retire dimgrey_cavefish hardcode for the use of 
soft PTable

The PPTable provided by VBIOS can be used.

Signed-off-by: Tao Zhou 
---
 drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c 
b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
index b23311096467..d5fa0d9dd7eb 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
@@ -339,8 +339,7 @@ int smu_v11_0_setup_pptable(struct smu_context *smu)
 hdr = (const struct smc_firmware_header_v1_0 *) adev->pm.fw->data;
 version_major = le16_to_cpu(hdr->header.header_version_major);
 version_minor = le16_to_cpu(hdr->header.header_version_minor);
-if ((version_major == 2 && smu->smu_table.boot_values.pp_table_id > 0) ||
-adev->asic_type == CHIP_DIMGREY_CAVEFISH) {
+if (version_major == 2 && smu->smu_table.boot_values.pp_table_id > 0) {
 dev_info(adev->dev, "use driver provided pptable %d\n", 
smu->smu_table.boot_values.pp_table_id);
 switch (version_minor) {
 case 0:
--
2.17.1

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


Re: [PATCH] drm/amd/pm: retire dimgrey_cavefish hardcode for the use of soft PTable

2020-11-16 Thread Deucher, Alexander
[AMD Official Use Only - Internal Distribution Only]

Acked-by: Alex Deucher 

From: amd-gfx  on behalf of Tao Zhou 

Sent: Monday, November 16, 2020 10:31 PM
To: Chen, Jiansong (Simon) ; Gui, Jack 
; Zhang, Hawking ; 
amd-gfx@lists.freedesktop.org 
Cc: Zhou1, Tao 
Subject: [PATCH] drm/amd/pm: retire dimgrey_cavefish hardcode for the use of 
soft PTable

The PPTable provided by VBIOS can be used.

Signed-off-by: Tao Zhou 
---
 drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c 
b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
index b23311096467..d5fa0d9dd7eb 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
@@ -339,8 +339,7 @@ int smu_v11_0_setup_pptable(struct smu_context *smu)
 hdr = (const struct smc_firmware_header_v1_0 *) 
adev->pm.fw->data;
 version_major = le16_to_cpu(hdr->header.header_version_major);
 version_minor = le16_to_cpu(hdr->header.header_version_minor);
-   if ((version_major == 2 && 
smu->smu_table.boot_values.pp_table_id > 0) ||
-   adev->asic_type == CHIP_DIMGREY_CAVEFISH) {
+   if (version_major == 2 && 
smu->smu_table.boot_values.pp_table_id > 0) {
 dev_info(adev->dev, "use driver provided pptable 
%d\n", smu->smu_table.boot_values.pp_table_id);
 switch (version_minor) {
 case 0:
--
2.17.1

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfxdata=04%7C01%7Calexander.deucher%40amd.com%7Cccfce44c5e5843177c7a08d88aa95ec3%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637411807349472302%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=8bUpARFZbEDD9hF2ksu32HtFV6BdQTkPcYxMlFR33rM%3Dreserved=0
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH] drm/amd/pm: retire dimgrey_cavefish hardcode for the use of soft PTable

2020-11-16 Thread Tao Zhou
The PPTable provided by VBIOS can be used.

Signed-off-by: Tao Zhou 
---
 drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c 
b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
index b23311096467..d5fa0d9dd7eb 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
@@ -339,8 +339,7 @@ int smu_v11_0_setup_pptable(struct smu_context *smu)
hdr = (const struct smc_firmware_header_v1_0 *) 
adev->pm.fw->data;
version_major = le16_to_cpu(hdr->header.header_version_major);
version_minor = le16_to_cpu(hdr->header.header_version_minor);
-   if ((version_major == 2 && 
smu->smu_table.boot_values.pp_table_id > 0) ||
-   adev->asic_type == CHIP_DIMGREY_CAVEFISH) {
+   if (version_major == 2 && 
smu->smu_table.boot_values.pp_table_id > 0) {
dev_info(adev->dev, "use driver provided pptable %d\n", 
smu->smu_table.boot_values.pp_table_id);
switch (version_minor) {
case 0:
-- 
2.17.1

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


Re: [PATCH 01/42] drm/amd/amdgpu/atombios_encoders: Remove set but unused variable 'backlight_level'

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:41 PM Lee Jones  wrote:
>
> Also removing the call to 
> amdgpu_atombios_encoder_get_backlight_level_from_reg()
> since, according to Alex Deucher, "We call it again below indirectly".
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/atombios_encoders.c: In function 
> ‘amdgpu_atombios_encoder_init_backlight’:
>  drivers/gpu/drm/amd/amdgpu/atombios_encoders.c:174:5: warning: variable 
> ‘backlight_level’ set but not used [-Wunused-but-set-variable]
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Luben Tuikov 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/atombios_encoders.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c 
> b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
> index fa817ebff9804..6134ed9640279 100644
> --- a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
> +++ b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
> @@ -171,7 +171,6 @@ void amdgpu_atombios_encoder_init_backlight(struct 
> amdgpu_encoder *amdgpu_encode
> struct backlight_properties props;
> struct amdgpu_backlight_privdata *pdata;
> struct amdgpu_encoder_atom_dig *dig;
> -   u8 backlight_level;
> char bl_name[16];
>
> /* Mac laptops with multiple GPUs use the gmux driver for backlight
> @@ -207,8 +206,6 @@ void amdgpu_atombios_encoder_init_backlight(struct 
> amdgpu_encoder *amdgpu_encode
>
> pdata->encoder = amdgpu_encoder;
>
> -   backlight_level = 
> amdgpu_atombios_encoder_get_backlight_level_from_reg(adev);
> -
> dig = amdgpu_encoder->enc_priv;
> dig->bl_dev = bd;
>
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 43/43] drm/radeon/radeon_drv: Move 'radeon_gem_prime_import_sg_table()'s prototype to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:38 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_prime.c:43:24: warning: no previous prototype 
> for ‘radeon_gem_prime_import_sg_table’ [-Wmissing-prototypes]
>  43 | struct drm_gem_object *radeon_gem_prime_import_sg_table(struct 
> drm_device *dev,
>  | ^~~~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Gareth Hughes 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/radeon_drv.c   | 4 +---
>  drivers/gpu/drm/radeon/radeon_prime.h | 3 +++
>  2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c 
> b/drivers/gpu/drm/radeon/radeon_drv.c
> index 211932d73b191..7a0989b397da1 100644
> --- a/drivers/gpu/drm/radeon/radeon_drv.c
> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
> @@ -55,6 +55,7 @@
>  #include "radeon_ttm.h"
>  #include "radeon.h"
>  #include "radeon_device.h"
> +#include "radeon_prime.h"
>
>  /*
>   * KMS wrapper.
> @@ -129,9 +130,6 @@ int radeon_mode_dumb_mmap(struct drm_file *filp,
>  int radeon_mode_dumb_create(struct drm_file *file_priv,
> struct drm_device *dev,
> struct drm_mode_create_dumb *args);
> -struct drm_gem_object *radeon_gem_prime_import_sg_table(struct drm_device 
> *dev,
> -   struct 
> dma_buf_attachment *,
> -   struct sg_table *sg);
>
>  /* atpx handler */
>  #if defined(CONFIG_VGA_SWITCHEROO)
> diff --git a/drivers/gpu/drm/radeon/radeon_prime.h 
> b/drivers/gpu/drm/radeon/radeon_prime.h
> index 11b7f80987834..24ddfd4b48a6d 100644
> --- a/drivers/gpu/drm/radeon/radeon_prime.h
> +++ b/drivers/gpu/drm/radeon/radeon_prime.h
> @@ -35,5 +35,8 @@ int radeon_gem_prime_pin(struct drm_gem_object *obj);
>  void radeon_gem_prime_unpin(struct drm_gem_object *obj);
>  void *radeon_gem_prime_vmap(struct drm_gem_object *obj);
>  void radeon_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr);
> +struct drm_gem_object *radeon_gem_prime_import_sg_table(struct drm_device 
> *dev,
> +   struct 
> dma_buf_attachment *,
> +   struct sg_table *sg);
>
>  #endif /* __RADEON_PRIME_H__ */
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 42/43] drm/radeon/radeon_audio: Move 'r600_*' prototypes into shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:38 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/r600_hdmi.c:177:6: warning: no previous prototype for 
> ‘r600_hdmi_update_acr’ [-Wmissing-prototypes]
>  177 | void r600_hdmi_update_acr(struct drm_encoder *encoder, long offset,
>  | ^~~~
>  drivers/gpu/drm/radeon/r600_hdmi.c:217:6: warning: no previous prototype for 
> ‘r600_set_avi_packet’ [-Wmissing-prototypes]
>  217 | void r600_set_avi_packet(struct radeon_device *rdev, u32 offset,
>  | ^~~
>  drivers/gpu/drm/radeon/r600_hdmi.c:314:6: warning: no previous prototype for 
> ‘r600_hdmi_audio_set_dto’ [-Wmissing-prototypes]
>  314 | void r600_hdmi_audio_set_dto(struct radeon_device *rdev,
>  | ^~~
>  drivers/gpu/drm/radeon/r600_hdmi.c:340:6: warning: no previous prototype for 
> ‘r600_set_vbi_packet’ [-Wmissing-prototypes]
>  340 | void r600_set_vbi_packet(struct drm_encoder *encoder, u32 offset)
>  | ^~~
>  drivers/gpu/drm/radeon/r600_hdmi.c:351:6: warning: no previous prototype for 
> ‘r600_set_audio_packet’ [-Wmissing-prototypes]
>  351 | void r600_set_audio_packet(struct drm_encoder *encoder, u32 offset)
>  | ^
>  drivers/gpu/drm/radeon/r600_hdmi.c:393:6: warning: no previous prototype for 
> ‘r600_set_mute’ [-Wmissing-prototypes]
>  393 | void r600_set_mute(struct drm_encoder *encoder, u32 offset, bool mute)
>  | ^
>  drivers/gpu/drm/radeon/r600_hdmi.c:469:6: warning: no previous prototype for 
> ‘r600_hdmi_enable’ [-Wmissing-prototypes]
>  469 | void r600_hdmi_enable(struct drm_encoder *encoder, bool enable)
>  | ^~~~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/r600.h | 17 +
>  drivers/gpu/drm/radeon/r600_hdmi.c|  1 +
>  drivers/gpu/drm/radeon/radeon_audio.c | 13 +
>  3 files changed, 19 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/r600.h b/drivers/gpu/drm/radeon/r600.h
> index dbdff4568516b..22db13b256195 100644
> --- a/drivers/gpu/drm/radeon/r600.h
> +++ b/drivers/gpu/drm/radeon/r600.h
> @@ -30,12 +30,29 @@
>
>  struct radeon_bo_list;
>  struct radeon_cs_parser;
> +struct r600_audio_pin;
> +struct radeon_crtc;
>  struct radeon_device;
> +struct radeon_hdmi_acr;
>
>  u32 r600_gpu_check_soft_reset(struct radeon_device *rdev);
>  int r600_ih_ring_alloc(struct radeon_device *rdev);
>  void r600_ih_ring_fini(struct radeon_device *rdev);
>
> +void r600_audio_enable(struct radeon_device *rdev, struct r600_audio_pin 
> *pin,
> +  u8 enable_mask);
> +void r600_set_audio_packet(struct drm_encoder *encoder, u32 offset);
> +void r600_set_mute(struct drm_encoder *encoder, u32 offset, bool mute);
> +void r600_hdmi_audio_set_dto(struct radeon_device *rdev,
> +struct radeon_crtc *crtc, unsigned int clock);
> +void r600_set_avi_packet(struct radeon_device *rdev, u32 offset,
> +unsigned char *buffer, size_t size);
> +void r600_hdmi_update_acr(struct drm_encoder *encoder, long offset,
> + const struct radeon_hdmi_acr *acr);
> +void r600_set_vbi_packet(struct drm_encoder *encoder, u32 offset);
> +void r600_hdmi_enable(struct drm_encoder *encoder, bool enable);
> +
>  int r600_dma_cs_next_reloc(struct radeon_cs_parser *p,
>struct radeon_bo_list **cs_reloc);
> +
>  #endif /* __R600_H__ */
> diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c 
> b/drivers/gpu/drm/radeon/r600_hdmi.c
> index c09549d785b54..f3551ebaa2f08 100644
> --- a/drivers/gpu/drm/radeon/r600_hdmi.c
> +++ b/drivers/gpu/drm/radeon/r600_hdmi.c
> @@ -30,6 +30,7 @@
>  #include "radeon.h"
>  #include "radeon_asic.h"
>  #include "radeon_audio.h"
> +#include "r600.h"
>  #include "r600d.h"
>  #include "atom.h"
>
> diff --git a/drivers/gpu/drm/radeon/radeon_audio.c 
> b/drivers/gpu/drm/radeon/radeon_audio.c
> index 785c23cb30589..7c5e80d03fc90 100644
> --- a/drivers/gpu/drm/radeon/radeon_audio.c
> +++ b/drivers/gpu/drm/radeon/radeon_audio.c
> @@ -29,28 +29,17 @@
>  #include "evergreen_hdmi.h"
>  #include "radeon.h"
>  #include "atom.h"
> +#include "r600.h"
>  #include "radeon_audio.h"
>
> -void r600_audio_enable(struct radeon_device *rdev, struct r600_audio_pin 
> *pin,
> -   u8 enable_mask);
>  void dce6_audio_enable(struct radeon_device *rdev, struct r600_audio_pin 
> *pin,
> u8 enable_mask);
>  struct r600_audio_pin* r600_audio_get_pin(struct radeon_device *rdev);
>  struct r600_audio_pin* dce6_audio_get_pin(struct radeon_device *rdev);
> -void r600_hdmi_audio_set_dto(struct radeon_device *rdev,
> -   struct radeon_crtc *crtc, unsigned int clock);
> -void 

Re: [PATCH 41/43] drm/radeon/evergreen_cs: Move 'r600_dma_cs_next_reloc()'s prototype to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:38 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/r600_cs.c:2343:5: warning: no previous prototype for 
> ‘r600_dma_cs_next_reloc’ [-Wmissing-prototypes]
>  2343 | int r600_dma_cs_next_reloc(struct radeon_cs_parser *p,
>  | ^~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/evergreen_cs.c | 3 +--
>  drivers/gpu/drm/radeon/r600.h | 4 
>  drivers/gpu/drm/radeon/r600_cs.c  | 1 +
>  3 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c 
> b/drivers/gpu/drm/radeon/evergreen_cs.c
> index 53b75cf201958..0de79f3a7e3ff 100644
> --- a/drivers/gpu/drm/radeon/evergreen_cs.c
> +++ b/drivers/gpu/drm/radeon/evergreen_cs.c
> @@ -28,6 +28,7 @@
>
>  #include "radeon.h"
>  #include "radeon_asic.h"
> +#include "r600.h"
>  #include "evergreend.h"
>  #include "evergreen_reg_safe.h"
>  #include "cayman_reg_safe.h"
> @@ -37,8 +38,6 @@
>
>  #define REG_SAFE_BM_SIZE ARRAY_SIZE(evergreen_reg_safe_bm)
>
> -int r600_dma_cs_next_reloc(struct radeon_cs_parser *p,
> -  struct radeon_bo_list **cs_reloc);
>  struct evergreen_cs_track {
> u32 group_size;
> u32 nbanks;
> diff --git a/drivers/gpu/drm/radeon/r600.h b/drivers/gpu/drm/radeon/r600.h
> index e66ef58706cd8..dbdff4568516b 100644
> --- a/drivers/gpu/drm/radeon/r600.h
> +++ b/drivers/gpu/drm/radeon/r600.h
> @@ -28,10 +28,14 @@
>  #ifndef __R600_H__
>  #define __R600_H__
>
> +struct radeon_bo_list;
> +struct radeon_cs_parser;
>  struct radeon_device;
>
>  u32 r600_gpu_check_soft_reset(struct radeon_device *rdev);
>  int r600_ih_ring_alloc(struct radeon_device *rdev);
>  void r600_ih_ring_fini(struct radeon_device *rdev);
>
> +int r600_dma_cs_next_reloc(struct radeon_cs_parser *p,
> +  struct radeon_bo_list **cs_reloc);
>  #endif /* __R600_H__ */
> diff --git a/drivers/gpu/drm/radeon/r600_cs.c 
> b/drivers/gpu/drm/radeon/r600_cs.c
> index f20b619466816..dc68e538d5a97 100644
> --- a/drivers/gpu/drm/radeon/r600_cs.c
> +++ b/drivers/gpu/drm/radeon/r600_cs.c
> @@ -29,6 +29,7 @@
>
>  #include "radeon.h"
>  #include "radeon_asic.h"
> +#include "r600.h"
>  #include "r600d.h"
>  #include "r600_reg_safe.h"
>
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 40/43] drm/radeon/cik: Move 'vce_v2_0_enable_mgcg()'s prototype to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:38 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/vce_v2_0.c:111:6: warning: no previous prototype for 
> ‘vce_v2_0_enable_mgcg’ [-Wmissing-prototypes]
>  111 | void vce_v2_0_enable_mgcg(struct radeon_device *rdev, bool enable)
>  | ^~~~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/cik.c  | 2 +-
>  drivers/gpu/drm/radeon/vce.h  | 1 +
>  drivers/gpu/drm/radeon/vce_v2_0.c | 1 +
>  3 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
> index 2af76463906ad..8b7a4f7b75766 100644
> --- a/drivers/gpu/drm/radeon/cik.c
> +++ b/drivers/gpu/drm/radeon/cik.c
> @@ -41,6 +41,7 @@
>  #include "radeon_audio.h"
>  #include "radeon_ucode.h"
>  #include "si.h"
> +#include "vce.h"
>
>  #define SH_MEM_CONFIG_GFX_DEFAULT \
> ALIGNMENT_MODE(SH_MEM_ALIGNMENT_MODE_UNALIGNED)
> @@ -129,7 +130,6 @@ MODULE_FIRMWARE("radeon/mullins_rlc.bin");
>  MODULE_FIRMWARE("radeon/mullins_sdma.bin");
>
>  static u32 cik_get_cu_active_bitmap(struct radeon_device *rdev, u32 se, u32 
> sh);
> -extern void vce_v2_0_enable_mgcg(struct radeon_device *rdev, bool enable);
>  static void cik_rlc_stop(struct radeon_device *rdev);
>  static void cik_pcie_gen3_enable(struct radeon_device *rdev);
>  static void cik_program_aspm(struct radeon_device *rdev);
> diff --git a/drivers/gpu/drm/radeon/vce.h b/drivers/gpu/drm/radeon/vce.h
> index 1eb4f5715202e..ccc9c00f0d02c 100644
> --- a/drivers/gpu/drm/radeon/vce.h
> +++ b/drivers/gpu/drm/radeon/vce.h
> @@ -30,5 +30,6 @@
>  struct radeon_device;
>
>  void vce_v1_0_enable_mgcg(struct radeon_device *rdev, bool enable);
> +void vce_v2_0_enable_mgcg(struct radeon_device *rdev, bool enable);
>
>  #endif /* __VCE_H__ */
> diff --git a/drivers/gpu/drm/radeon/vce_v2_0.c 
> b/drivers/gpu/drm/radeon/vce_v2_0.c
> index d6fde3659e65f..163c9bfc03da8 100644
> --- a/drivers/gpu/drm/radeon/vce_v2_0.c
> +++ b/drivers/gpu/drm/radeon/vce_v2_0.c
> @@ -30,6 +30,7 @@
>  #include "radeon.h"
>  #include "radeon_asic.h"
>  #include "cikd.h"
> +#include "vce.h"
>
>  #define VCE_V2_0_FW_SIZE   (256 * 1024)
>  #define VCE_V2_0_STACK_SIZE(64 * 1024)
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH v2 1/8] drm: Add dummy page per device or GEM object

2020-11-16 Thread Andrey Grodzovsky


On 11/16/20 3:36 PM, Christian König wrote:

Am 16.11.20 um 20:00 schrieb Andrey Grodzovsky:


On 11/16/20 4:48 AM, Christian König wrote:

Am 15.11.20 um 07:34 schrieb Andrey Grodzovsky:


On 11/14/20 4:51 AM, Daniel Vetter wrote:

On Sat, Nov 14, 2020 at 9:41 AM Christian König
 wrote:

Am 13.11.20 um 21:52 schrieb Andrey Grodzovsky:

On 6/22/20 1:50 PM, Daniel Vetter wrote:

On Mon, Jun 22, 2020 at 7:45 PM Christian König
 wrote:

Am 22.06.20 um 16:32 schrieb Andrey Grodzovsky:

On 6/22/20 9:18 AM, Christian König wrote:

Am 21.06.20 um 08:03 schrieb Andrey Grodzovsky:

Will be used to reroute CPU mapped BO's page faults once
device is removed.

Signed-off-by: Andrey Grodzovsky 
---
    drivers/gpu/drm/drm_file.c  |  8 
    drivers/gpu/drm/drm_prime.c | 10 ++
    include/drm/drm_file.h  |  2 ++
    include/drm/drm_gem.h   |  2 ++
    4 files changed, 22 insertions(+)

diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c
index c4c704e..67c0770 100644
--- a/drivers/gpu/drm/drm_file.c
+++ b/drivers/gpu/drm/drm_file.c
@@ -188,6 +188,12 @@ struct drm_file *drm_file_alloc(struct
drm_minor *minor)
    goto out_prime_destroy;
    }
    +    file->dummy_page = alloc_page(GFP_KERNEL | __GFP_ZERO);
+    if (!file->dummy_page) {
+    ret = -ENOMEM;
+    goto out_prime_destroy;
+    }
+
    return file;
  out_prime_destroy:
@@ -284,6 +290,8 @@ void drm_file_free(struct drm_file *file)
    if (dev->driver->postclose)
dev->driver->postclose(dev, file);
    +    __free_page(file->dummy_page);
+
drm_prime_destroy_file_private(>prime);
WARN_ON(!list_empty(>event_list));
diff --git a/drivers/gpu/drm/drm_prime.c
b/drivers/gpu/drm/drm_prime.c
index 1de2cde..c482e9c 100644
--- a/drivers/gpu/drm/drm_prime.c
+++ b/drivers/gpu/drm/drm_prime.c
@@ -335,6 +335,13 @@ int drm_gem_prime_fd_to_handle(struct
drm_device *dev,
  ret = drm_prime_add_buf_handle(_priv->prime,
    dma_buf, *handle);
+
+    if (!ret) {
+    obj->dummy_page = alloc_page(GFP_KERNEL | __GFP_ZERO);
+    if (!obj->dummy_page)
+    ret = -ENOMEM;
+    }
+

While the per file case still looks acceptable this is a clear NAK
since it will massively increase the memory needed for a prime
exported object.

I think that this is quite overkill in the first place and for the
hot unplug case we can just use the global dummy page as well.

Christian.

Global dummy page is good for read access, what do you do on write
access ? My first approach was indeed to map at first global dummy
page as read only and mark the vma->vm_flags as !VM_SHARED assuming
that this would trigger Copy On Write flow in core mm
(https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Felixir.bootlin.com%2Flinux%2Fv5.7-rc7%2Fsource%2Fmm%2Fmemory.c%23L3977data=04%7C01%7CAndrey.Grodzovsky%40amd.com%7C00053e9d983041ed63ae08d2ed87%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637409443224016377%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=kghiG3VpCJod6YefExoDVPl9X03zNhw3SN5GAxgbnmU%3Dreserved=0) 



on the next page fault to same address triggered by a write access but
then i realized a new COW page will be allocated for each such mapping
and this is much more wasteful then having a dedicated page per GEM
object.

Yeah, but this is only for a very very small corner cases. What we need
to prevent is increasing the memory usage during normal operation to
much.

Using memory during the unplug is completely unproblematic because we
just released quite a bunch of it by releasing all those system memory
buffers.

And I'm pretty sure that COWed pages are correctly accounted towards
the
used memory of a process.

So I think if that approach works as intended and the COW pages are
released again on unmapping it would be the perfect solution to the
problem.

Daniel what do you think?

If COW works, sure sounds reasonable. And if we can make sure we
managed to drop all the system allocations (otherwise suddenly 2x
memory usage, worst case). But I have no idea whether we can
retroshoehorn that into an established vma, you might have fun stuff
like a mkwrite handler there (which I thought is the COW handler
thing, but really no idea).

If we need to massively change stuff then I think rw dummy page,
allocated on first fault after hotunplug (maybe just make it one per
object, that's simplest) seems like the much safer option. Much less
code that can go wrong.
-Daniel


Regarding COW, i was looking into how to properly implement it from
within the fault handler (i.e. ttm_bo_vm_fault)
and the main obstacle I hit is that of exclusive access to the
vm_area_struct, i need to be able to modify
vma->vm_flags (and vm_page_prot)  to remove VM_SHARED bit so COW can
be triggered on subsequent write access
fault (here

Re: [PATCH 39/43] drm/radeon/si_dpm: Move 'vce_v1_0_enable_mgcg()'s prototype to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:38 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/vce_v1_0.c:102:6: warning: no previous prototype for 
> ‘vce_v1_0_enable_mgcg’ [-Wmissing-prototypes]
>  102 | void vce_v1_0_enable_mgcg(struct radeon_device *rdev, bool enable)
>  | ^~~~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/si_dpm.c  |  3 +--
>  drivers/gpu/drm/radeon/trinity_dpm.c |  2 +-
>  drivers/gpu/drm/radeon/vce.h | 34 
>  drivers/gpu/drm/radeon/vce_v1_0.c|  1 +
>  4 files changed, 37 insertions(+), 3 deletions(-)
>  create mode 100644 drivers/gpu/drm/radeon/vce.h
>
> diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c
> index b4581392fbce9..cd07b06301b44 100644
> --- a/drivers/gpu/drm/radeon/si_dpm.c
> +++ b/drivers/gpu/drm/radeon/si_dpm.c
> @@ -35,6 +35,7 @@
>  #include "si_dpm.h"
>  #include "si.h"
>  #include "sid.h"
> +#include "vce.h"
>
>  #define MC_CG_ARB_FREQ_F0   0x0a
>  #define MC_CG_ARB_FREQ_F1   0x0b
> @@ -1721,8 +1722,6 @@ static const struct si_powertune_data 
> powertune_data_hainan =
> true
>  };
>
> -extern void vce_v1_0_enable_mgcg(struct radeon_device *rdev, bool enable);
> -
>  static int si_populate_voltage_value(struct radeon_device *rdev,
>  const struct atom_voltage_table *table,
>  u16 value, SISLANDS_SMC_VOLTAGE_VALUE 
> *voltage);
> diff --git a/drivers/gpu/drm/radeon/trinity_dpm.c 
> b/drivers/gpu/drm/radeon/trinity_dpm.c
> index e005c18aac00e..08ea1c864cb23 100644
> --- a/drivers/gpu/drm/radeon/trinity_dpm.c
> +++ b/drivers/gpu/drm/radeon/trinity_dpm.c
> @@ -29,6 +29,7 @@
>  #include "radeon_asic.h"
>  #include "trinity_dpm.h"
>  #include "trinityd.h"
> +#include "vce.h"
>
>  #define TRINITY_MAX_DEEPSLEEP_DIVIDER_ID 5
>  #define TRINITY_MINIMUM_ENGINE_CLOCK 800
> @@ -293,7 +294,6 @@ static const u32 trinity_override_mgpg_sequences[] =
> 0x0204, 0x,
>  };
>
> -extern void vce_v1_0_enable_mgcg(struct radeon_device *rdev, bool enable);
>  static void trinity_program_clk_gating_hw_sequence(struct radeon_device 
> *rdev,
>const u32 *seq, u32 count);
>  static void trinity_override_dynamic_mg_powergating(struct radeon_device 
> *rdev);
> diff --git a/drivers/gpu/drm/radeon/vce.h b/drivers/gpu/drm/radeon/vce.h
> new file mode 100644
> index 0..1eb4f5715202e
> --- /dev/null
> +++ b/drivers/gpu/drm/radeon/vce.h
> @@ -0,0 +1,34 @@
> +/* vce.h -- Private header for radeon driver -*- linux-c -*-
> + *
> + * Copyright 2013 Advanced Micro Devices, Inc.
> + * All Rights Reserved.
> + *
> + * 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 rights to use, copy, modify, merge, publish,
> + * distribute, sub license, and/or sell copies of the Software, and to
> + * permit persons to whom the Software is furnished to do so, subject to
> + * the following conditions:
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
> + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY 
> CLAIM,
> + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
> + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
> + * USE OR OTHER DEALINGS IN THE SOFTWARE.
> + *
> + * The above copyright notice and this permission notice (including the
> + * next paragraph) shall be included in all copies or substantial portions
> + * of the Software.
> + */
> +
> +#ifndef __VCE_H__
> +#define __VCE_H__
> +
> +struct radeon_device;
> +
> +void vce_v1_0_enable_mgcg(struct radeon_device *rdev, bool enable);
> +
> +#endif /* __VCE_H__ */
> diff --git a/drivers/gpu/drm/radeon/vce_v1_0.c 
> b/drivers/gpu/drm/radeon/vce_v1_0.c
> index bd75bbcf5bf63..70c5da2141d75 100644
> --- a/drivers/gpu/drm/radeon/vce_v1_0.c
> +++ b/drivers/gpu/drm/radeon/vce_v1_0.c
> @@ -30,6 +30,7 @@
>  #include "radeon.h"
>  #include "radeon_asic.h"
>  #include "sid.h"
> +#include "vce.h"
>
>  #define VCE_V1_0_FW_SIZE   (256 * 1024)
>  #define VCE_V1_0_STACK_SIZE(64 * 1024)
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH 38/43] drm/radeon/cik: Move 'Move 'cik_sdma_*()'s prototypes to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:38 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/cik_sdma.c:331:6: warning: no previous prototype for 
> ‘cik_sdma_enable’ [-Wmissing-prototypes]
>  331 | void cik_sdma_enable(struct radeon_device *rdev, bool enable)
>  | ^~~
>  drivers/gpu/drm/radeon/cik_sdma.c:528:5: warning: no previous prototype for 
> ‘cik_sdma_resume’ [-Wmissing-prototypes]
>  528 | int cik_sdma_resume(struct radeon_device *rdev)
>  | ^~~
>  drivers/gpu/drm/radeon/cik_sdma.c:557:6: warning: no previous prototype for 
> ‘cik_sdma_fini’ [-Wmissing-prototypes]
>  557 | void cik_sdma_fini(struct radeon_device *rdev)
>  | ^
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/cik.c | 3 ---
>  drivers/gpu/drm/radeon/cik.h | 3 +++
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
> index cef0f3111cd3a..2af76463906ad 100644
> --- a/drivers/gpu/drm/radeon/cik.c
> +++ b/drivers/gpu/drm/radeon/cik.c
> @@ -129,9 +129,6 @@ MODULE_FIRMWARE("radeon/mullins_rlc.bin");
>  MODULE_FIRMWARE("radeon/mullins_sdma.bin");
>
>  static u32 cik_get_cu_active_bitmap(struct radeon_device *rdev, u32 se, u32 
> sh);
> -extern int cik_sdma_resume(struct radeon_device *rdev);
> -extern void cik_sdma_enable(struct radeon_device *rdev, bool enable);
> -extern void cik_sdma_fini(struct radeon_device *rdev);
>  extern void vce_v2_0_enable_mgcg(struct radeon_device *rdev, bool enable);
>  static void cik_rlc_stop(struct radeon_device *rdev);
>  static void cik_pcie_gen3_enable(struct radeon_device *rdev);
> diff --git a/drivers/gpu/drm/radeon/cik.h b/drivers/gpu/drm/radeon/cik.h
> index 420207d19de52..d1bf541da5923 100644
> --- a/drivers/gpu/drm/radeon/cik.h
> +++ b/drivers/gpu/drm/radeon/cik.h
> @@ -34,4 +34,7 @@ void cik_init_cp_pg_table(struct radeon_device *rdev);
>  u32 cik_get_csb_size(struct radeon_device *rdev);
>  void cik_get_csb_buffer(struct radeon_device *rdev, volatile u32 *buffer);
>
> +int cik_sdma_resume(struct radeon_device *rdev);
> +void cik_sdma_enable(struct radeon_device *rdev, bool enable);
> +void cik_sdma_fini(struct radeon_device *rdev);
>  #endif /* __CIK_H__ */
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH v2 1/8] drm: Add dummy page per device or GEM object

2020-11-16 Thread Christian König

Am 16.11.20 um 20:00 schrieb Andrey Grodzovsky:


On 11/16/20 4:48 AM, Christian König wrote:

Am 15.11.20 um 07:34 schrieb Andrey Grodzovsky:


On 11/14/20 4:51 AM, Daniel Vetter wrote:

On Sat, Nov 14, 2020 at 9:41 AM Christian König
 wrote:

Am 13.11.20 um 21:52 schrieb Andrey Grodzovsky:

On 6/22/20 1:50 PM, Daniel Vetter wrote:

On Mon, Jun 22, 2020 at 7:45 PM Christian König
 wrote:

Am 22.06.20 um 16:32 schrieb Andrey Grodzovsky:

On 6/22/20 9:18 AM, Christian König wrote:

Am 21.06.20 um 08:03 schrieb Andrey Grodzovsky:

Will be used to reroute CPU mapped BO's page faults once
device is removed.

Signed-off-by: Andrey Grodzovsky 
---
    drivers/gpu/drm/drm_file.c  |  8 
    drivers/gpu/drm/drm_prime.c | 10 ++
    include/drm/drm_file.h  |  2 ++
    include/drm/drm_gem.h   |  2 ++
    4 files changed, 22 insertions(+)

diff --git a/drivers/gpu/drm/drm_file.c 
b/drivers/gpu/drm/drm_file.c

index c4c704e..67c0770 100644
--- a/drivers/gpu/drm/drm_file.c
+++ b/drivers/gpu/drm/drm_file.c
@@ -188,6 +188,12 @@ struct drm_file *drm_file_alloc(struct
drm_minor *minor)
    goto out_prime_destroy;
    }
    +    file->dummy_page = alloc_page(GFP_KERNEL | 
__GFP_ZERO);

+    if (!file->dummy_page) {
+    ret = -ENOMEM;
+    goto out_prime_destroy;
+    }
+
    return file;
  out_prime_destroy:
@@ -284,6 +290,8 @@ void drm_file_free(struct drm_file *file)
    if (dev->driver->postclose)
    dev->driver->postclose(dev, file);
    +    __free_page(file->dummy_page);
+
drm_prime_destroy_file_private(>prime);
WARN_ON(!list_empty(>event_list));
diff --git a/drivers/gpu/drm/drm_prime.c
b/drivers/gpu/drm/drm_prime.c
index 1de2cde..c482e9c 100644
--- a/drivers/gpu/drm/drm_prime.c
+++ b/drivers/gpu/drm/drm_prime.c
@@ -335,6 +335,13 @@ int drm_gem_prime_fd_to_handle(struct
drm_device *dev,
  ret = drm_prime_add_buf_handle(_priv->prime,
    dma_buf, *handle);
+
+    if (!ret) {
+    obj->dummy_page = alloc_page(GFP_KERNEL | __GFP_ZERO);
+    if (!obj->dummy_page)
+    ret = -ENOMEM;
+    }
+
While the per file case still looks acceptable this is a 
clear NAK

since it will massively increase the memory needed for a prime
exported object.

I think that this is quite overkill in the first place and 
for the

hot unplug case we can just use the global dummy page as well.

Christian.
Global dummy page is good for read access, what do you do on 
write
access ? My first approach was indeed to map at first global 
dummy
page as read only and mark the vma->vm_flags as !VM_SHARED 
assuming

that this would trigger Copy On Write flow in core mm
(https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Felixir.bootlin.com%2Flinux%2Fv5.7-rc7%2Fsource%2Fmm%2Fmemory.c%23L3977data=04%7C01%7CAndrey.Grodzovsky%40amd.com%7C00053e9d983041ed63ae08d2ed87%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637409443224016377%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=kghiG3VpCJod6YefExoDVPl9X03zNhw3SN5GAxgbnmU%3Dreserved=0) 



on the next page fault to same address triggered by a write 
access but
then i realized a new COW page will be allocated for each such 
mapping
and this is much more wasteful then having a dedicated page 
per GEM

object.
Yeah, but this is only for a very very small corner cases. What 
we need
to prevent is increasing the memory usage during normal 
operation to

much.

Using memory during the unplug is completely unproblematic 
because we
just released quite a bunch of it by releasing all those system 
memory

buffers.

And I'm pretty sure that COWed pages are correctly accounted 
towards

the
used memory of a process.

So I think if that approach works as intended and the COW pages 
are
released again on unmapping it would be the perfect solution to 
the

problem.

Daniel what do you think?

If COW works, sure sounds reasonable. And if we can make sure we
managed to drop all the system allocations (otherwise suddenly 2x
memory usage, worst case). But I have no idea whether we can
retroshoehorn that into an established vma, you might have fun 
stuff

like a mkwrite handler there (which I thought is the COW handler
thing, but really no idea).

If we need to massively change stuff then I think rw dummy page,
allocated on first fault after hotunplug (maybe just make it one 
per
object, that's simplest) seems like the much safer option. Much 
less

code that can go wrong.
-Daniel


Regarding COW, i was looking into how to properly implement it from
within the fault handler (i.e. ttm_bo_vm_fault)
and the main obstacle I hit is that of exclusive access to the
vm_area_struct, i need to be able to modify
vma->vm_flags (and vm_page_prot)  to remove VM_SHARED bit so COW can
be triggered on subsequent write access
fault (here

Re: [PATCH 37/43] drm/radeon/ci_dpm: Move 'si_*()'s prototypes to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:38 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/si_dpm.c:3802:4: warning: no previous prototype for 
> ‘si_get_ddr3_mclk_frequency_ratio’ [-Wmissing-prototypes]
>  3802 | u8 si_get_ddr3_mclk_frequency_ratio(u32 memory_clock)
>  | ^~~~
>  drivers/gpu/drm/radeon/si_dpm.c:3815:4: warning: no previous prototype for 
> ‘si_get_mclk_frequency_ratio’ [-Wmissing-prototypes]
>  3815 | u8 si_get_mclk_frequency_ratio(u32 memory_clock, bool strobe_mode)
>  | ^~~
>  drivers/gpu/drm/radeon/si_dpm.c:3897:6: warning: no previous prototype for 
> ‘si_trim_voltage_table_to_fit_state_table’ [-Wmissing-prototypes]
>  3897 | void si_trim_voltage_table_to_fit_state_table(struct radeon_device 
> *rdev,
>  | ^~~~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/ci_dpm.c | 6 +-
>  drivers/gpu/drm/radeon/si_dpm.h | 5 +
>  2 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c
> index a9fc0a552736c..0dfb0ed9af89d 100644
> --- a/drivers/gpu/drm/radeon/ci_dpm.c
> +++ b/drivers/gpu/drm/radeon/ci_dpm.c
> @@ -33,6 +33,7 @@
>  #include "radeon.h"
>  #include "radeon_asic.h"
>  #include "radeon_ucode.h"
> +#include "si_dpm.h"
>
>  #define MC_CG_ARB_FREQ_F0   0x0a
>  #define MC_CG_ARB_FREQ_F1   0x0b
> @@ -153,11 +154,6 @@ static const struct ci_pt_config_reg didt_config_ci[] =
>  extern u8 rv770_get_memory_module_index(struct radeon_device *rdev);
>  extern int ni_copy_and_switch_arb_sets(struct radeon_device *rdev,
>u32 arb_freq_src, u32 arb_freq_dest);
> -extern u8 si_get_ddr3_mclk_frequency_ratio(u32 memory_clock);
> -extern u8 si_get_mclk_frequency_ratio(u32 memory_clock, bool strobe_mode);
> -extern void si_trim_voltage_table_to_fit_state_table(struct radeon_device 
> *rdev,
> -u32 max_voltage_steps,
> -struct 
> atom_voltage_table *voltage_table);
>  static int ci_get_std_voltage_value_sidd(struct radeon_device *rdev,
>  struct atom_voltage_table_entry 
> *voltage_table,
>  u16 *std_voltage_hi_sidd, u16 
> *std_voltage_lo_sidd);
> diff --git a/drivers/gpu/drm/radeon/si_dpm.h b/drivers/gpu/drm/radeon/si_dpm.h
> index 1032a68be792b..aa857906ef93d 100644
> --- a/drivers/gpu/drm/radeon/si_dpm.h
> +++ b/drivers/gpu/drm/radeon/si_dpm.h
> @@ -234,5 +234,10 @@ struct si_power_info {
>  #define SISLANDS_CGULVPARAMETER_DFLT0x00040035
>  #define SISLANDS_CGULVCONTROL_DFLT  0x1f007550
>
> +u8 si_get_ddr3_mclk_frequency_ratio(u32 memory_clock);
> +u8 si_get_mclk_frequency_ratio(u32 memory_clock, bool strobe_mode);
> +void si_trim_voltage_table_to_fit_state_table(struct radeon_device *rdev,
> + u32 max_voltage_steps,
> + struct atom_voltage_table 
> *voltage_table);
>
>  #endif
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 36/43] drm/radeon/evergreen: Move 'cik_*()'s prototypes to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:38 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/cik.c:6413:6: warning: no previous prototype for 
> ‘cik_init_cp_pg_table’ [-Wmissing-prototypes]
>  6413 | void cik_init_cp_pg_table(struct radeon_device *rdev)
>  | ^~~~
>  drivers/gpu/drm/radeon/cik.c:6670:5: warning: no previous prototype for 
> ‘cik_get_csb_size’ [-Wmissing-prototypes]
>  6670 | u32 cik_get_csb_size(struct radeon_device *rdev)
>  | ^~~~
>  drivers/gpu/drm/radeon/cik.c:6702:6: warning: no previous prototype for 
> ‘cik_get_csb_buffer’ [-Wmissing-prototypes]
>  6702 | void cik_get_csb_buffer(struct radeon_device *rdev, volatile u32 
> *buffer)
>  | ^~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex


> ---
>  drivers/gpu/drm/radeon/cik.h   | 3 +++
>  drivers/gpu/drm/radeon/evergreen.c | 5 +
>  2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/cik.h b/drivers/gpu/drm/radeon/cik.h
> index 6630b9da9e7aa..420207d19de52 100644
> --- a/drivers/gpu/drm/radeon/cik.h
> +++ b/drivers/gpu/drm/radeon/cik.h
> @@ -30,5 +30,8 @@ void cik_exit_rlc_safe_mode(struct radeon_device *rdev);
>  int ci_mc_load_microcode(struct radeon_device *rdev);
>  void cik_update_cg(struct radeon_device *rdev, u32 block, bool enable);
>  u32 cik_gpu_check_soft_reset(struct radeon_device *rdev);
> +void cik_init_cp_pg_table(struct radeon_device *rdev);
> +u32 cik_get_csb_size(struct radeon_device *rdev);
> +void cik_get_csb_buffer(struct radeon_device *rdev, volatile u32 *buffer);
>
>  #endif /* __CIK_H__ */
> diff --git a/drivers/gpu/drm/radeon/evergreen.c 
> b/drivers/gpu/drm/radeon/evergreen.c
> index 4575e448e59df..8e9e88bf1f43d 100644
> --- a/drivers/gpu/drm/radeon/evergreen.c
> +++ b/drivers/gpu/drm/radeon/evergreen.c
> @@ -31,6 +31,7 @@
>
>  #include "atom.h"
>  #include "avivod.h"
> +#include "cik.h"
>  #include "ni.h"
>  #include "rv770.h"
>  #include "evergreen.h"
> @@ -217,10 +218,6 @@ static void evergreen_gpu_init(struct radeon_device 
> *rdev);
>  void evergreen_fini(struct radeon_device *rdev);
>  void evergreen_pcie_gen2_enable(struct radeon_device *rdev);
>  void evergreen_program_aspm(struct radeon_device *rdev);
> -void cik_init_cp_pg_table(struct radeon_device *rdev);
> -
> -extern u32 cik_get_csb_size(struct radeon_device *rdev);
> -extern void cik_get_csb_buffer(struct radeon_device *rdev, volatile u32 
> *buffer);
>
>  static const u32 evergreen_golden_registers[] =
>  {
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 35/43] drm/radeon/cik_sdma: Move 'amdgpu_cik_gpu_check_soft_reset()'s prototype to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:38 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/cik.c:4845:5: warning: no previous prototype for 
> ‘cik_gpu_check_soft_reset’ [-Wmissing-prototypes]
>  4845 | u32 cik_gpu_check_soft_reset(struct radeon_device *rdev)
>  | ^~~~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/cik.h  | 1 +
>  drivers/gpu/drm/radeon/cik_sdma.c | 3 +--
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/cik.h b/drivers/gpu/drm/radeon/cik.h
> index 297b3c1ff804f..6630b9da9e7aa 100644
> --- a/drivers/gpu/drm/radeon/cik.h
> +++ b/drivers/gpu/drm/radeon/cik.h
> @@ -29,5 +29,6 @@ void cik_enter_rlc_safe_mode(struct radeon_device *rdev);
>  void cik_exit_rlc_safe_mode(struct radeon_device *rdev);
>  int ci_mc_load_microcode(struct radeon_device *rdev);
>  void cik_update_cg(struct radeon_device *rdev, u32 block, bool enable);
> +u32 cik_gpu_check_soft_reset(struct radeon_device *rdev);
>
>  #endif /* __CIK_H__ */
> diff --git a/drivers/gpu/drm/radeon/cik_sdma.c 
> b/drivers/gpu/drm/radeon/cik_sdma.c
> index 3c709ebe8d1ab..919b14845c3c7 100644
> --- a/drivers/gpu/drm/radeon/cik_sdma.c
> +++ b/drivers/gpu/drm/radeon/cik_sdma.c
> @@ -27,14 +27,13 @@
>  #include "radeon_ucode.h"
>  #include "radeon_asic.h"
>  #include "radeon_trace.h"
> +#include "cik.h"
>  #include "cikd.h"
>
>  /* sdma */
>  #define CIK_SDMA_UCODE_SIZE 1050
>  #define CIK_SDMA_UCODE_VERSION 64
>
> -u32 cik_gpu_check_soft_reset(struct radeon_device *rdev);
> -
>  /*
>   * sDMA - System DMA
>   * Starting with CIK, the GPU has new asynchronous
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 34/43] drm/radeon/evergreen: Move 'si_get_csb_*()'s prototypes to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:37 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/si.c:5678:5: warning: no previous prototype for 
> ‘si_get_csb_size’ [-Wmissing-prototypes]
>  5678 | u32 si_get_csb_size(struct radeon_device *rdev)
>  | ^~~
>  drivers/gpu/drm/radeon/si.c:5710:6: warning: no previous prototype for 
> ‘si_get_csb_buffer’ [-Wmissing-prototypes]
>  5710 | void si_get_csb_buffer(struct radeon_device *rdev, volatile u32 
> *buffer)
>  | ^
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/evergreen.c | 3 +--
>  drivers/gpu/drm/radeon/si.h| 2 ++
>  2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/evergreen.c 
> b/drivers/gpu/drm/radeon/evergreen.c
> index 8fb0b8c3db5b5..4575e448e59df 100644
> --- a/drivers/gpu/drm/radeon/evergreen.c
> +++ b/drivers/gpu/drm/radeon/evergreen.c
> @@ -41,6 +41,7 @@
>  #include "radeon_asic.h"
>  #include "radeon_audio.h"
>  #include "radeon_ucode.h"
> +#include "si.h"
>
>  #define DC_HPDx_CONTROL(x)(DC_HPD1_CONTROL + (x * 0xc))
>  #define DC_HPDx_INT_CONTROL(x)(DC_HPD1_INT_CONTROL + (x * 0xc))
> @@ -218,8 +219,6 @@ void evergreen_pcie_gen2_enable(struct radeon_device 
> *rdev);
>  void evergreen_program_aspm(struct radeon_device *rdev);
>  void cik_init_cp_pg_table(struct radeon_device *rdev);
>
> -extern u32 si_get_csb_size(struct radeon_device *rdev);
> -extern void si_get_csb_buffer(struct radeon_device *rdev, volatile u32 
> *buffer);
>  extern u32 cik_get_csb_size(struct radeon_device *rdev);
>  extern void cik_get_csb_buffer(struct radeon_device *rdev, volatile u32 
> *buffer);
>
> diff --git a/drivers/gpu/drm/radeon/si.h b/drivers/gpu/drm/radeon/si.h
> index f483a64d17050..310c58376f927 100644
> --- a/drivers/gpu/drm/radeon/si.h
> +++ b/drivers/gpu/drm/radeon/si.h
> @@ -32,5 +32,7 @@ u32 si_gpu_check_soft_reset(struct radeon_device *rdev);
>  void si_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc);
>  void si_rlc_reset(struct radeon_device *rdev);
>  void si_init_uvd_internal_cg(struct radeon_device *rdev);
> +u32 si_get_csb_size(struct radeon_device *rdev);
> +void si_get_csb_buffer(struct radeon_device *rdev, volatile u32 *buffer);
>
>  #endif /* __SI_H__ */
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 33/43] drm/radeon/radeon_audio: Move 'dce6_*()'s prototypes to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:38 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/dce6_afmt.c:32:5: warning: no previous prototype for 
> ‘dce6_endpoint_rreg’ [-Wmissing-prototypes]
>  32 | u32 dce6_endpoint_rreg(struct radeon_device *rdev,
>  | ^~
>  drivers/gpu/drm/radeon/dce6_afmt.c:46:6: warning: no previous prototype for 
> ‘dce6_endpoint_wreg’ [-Wmissing-prototypes]
>  46 | void dce6_endpoint_wreg(struct radeon_device *rdev,
>  | ^~
>  drivers/gpu/drm/radeon/dce6_afmt.c:110:6: warning: no previous prototype for 
> ‘dce6_afmt_select_pin’ [-Wmissing-prototypes]
>  110 | void dce6_afmt_select_pin(struct drm_encoder *encoder)
>  | ^~~~
>  drivers/gpu/drm/radeon/dce6_afmt.c:123:6: warning: no previous prototype for 
> ‘dce6_afmt_write_latency_fields’ [-Wmissing-prototypes]
>  123 | void dce6_afmt_write_latency_fields(struct drm_encoder *encoder,
>  | ^~
>  drivers/gpu/drm/radeon/dce6_afmt.c:152:6: warning: no previous prototype for 
> ‘dce6_afmt_hdmi_write_speaker_allocation’ [-Wmissing-prototypes]
>  152 | void dce6_afmt_hdmi_write_speaker_allocation(struct drm_encoder 
> *encoder,
>  | ^~~
>  drivers/gpu/drm/radeon/dce6_afmt.c:177:6: warning: no previous prototype for 
> ‘dce6_afmt_dp_write_speaker_allocation’ [-Wmissing-prototypes]
>  177 | void dce6_afmt_dp_write_speaker_allocation(struct drm_encoder *encoder,
>  | ^
>  drivers/gpu/drm/radeon/dce6_afmt.c:202:6: warning: no previous prototype for 
> ‘dce6_afmt_write_sad_regs’ [-Wmissing-prototypes]
>  202 | void dce6_afmt_write_sad_regs(struct drm_encoder *encoder,
>  | ^~~~
>  drivers/gpu/drm/radeon/dce6_afmt.c:268:6: warning: no previous prototype for 
> ‘dce6_hdmi_audio_set_dto’ [-Wmissing-prototypes]
>  268 | void dce6_hdmi_audio_set_dto(struct radeon_device *rdev,
>  | ^~~
>  drivers/gpu/drm/radeon/dce6_afmt.c:287:6: warning: no previous prototype for 
> ‘dce6_dp_audio_set_dto’ [-Wmissing-prototypes]
>  287 | void dce6_dp_audio_set_dto(struct radeo_device *rdev,
>  | ^
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Slava Grigorev 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex


> ---
>  drivers/gpu/drm/radeon/dce6_afmt.c|  1 +
>  drivers/gpu/drm/radeon/dce6_afmt.h| 52 +++
>  drivers/gpu/drm/radeon/radeon_audio.c | 17 +
>  3 files changed, 54 insertions(+), 16 deletions(-)
>  create mode 100644 drivers/gpu/drm/radeon/dce6_afmt.h
>
> diff --git a/drivers/gpu/drm/radeon/dce6_afmt.c 
> b/drivers/gpu/drm/radeon/dce6_afmt.c
> index eec5d7a627388..4a1d5447eac17 100644
> --- a/drivers/gpu/drm/radeon/dce6_afmt.c
> +++ b/drivers/gpu/drm/radeon/dce6_afmt.c
> @@ -22,6 +22,7 @@
>   */
>  #include 
>
> +#include "dce6_afmt.h"
>  #include "radeon.h"
>  #include "radeon_audio.h"
>  #include "sid.h"
> diff --git a/drivers/gpu/drm/radeon/dce6_afmt.h 
> b/drivers/gpu/drm/radeon/dce6_afmt.h
> new file mode 100644
> index 0..176a538664a27
> --- /dev/null
> +++ b/drivers/gpu/drm/radeon/dce6_afmt.h
> @@ -0,0 +1,52 @@
> +/* dce6_afmt.h -- Private header for radeon driver -*- linux-c -*-
> + *
> + * Copyright 2013 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice shall be included in
> + * all copies or substantial portions of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> + * OTHER DEALINGS IN THE SOFTWARE.
> + *
> + */
> +
> +#ifndef __DCE6_AFMT_H__
> +#define __DCE6_AFMT_H__
> +
> +struct cea_sad;
> +struct drm_connector;
> +struct drm_display_mode;
> +struct drm_encoder;
> +struct radeon_crtc;
> +struct radeon_device;
> +
> +u32 dce6_endpoint_rreg(struct radeon_device *rdev, u32 offset, u32 reg);
> +void dce6_endpoint_wreg(struct radeon_device *rdev, u32 offset, u32 reg, u32 
> v);
> +void 

Re: [PATCH 32/43] drm/radeon/btc_dpm: Move 'evergreen_get_pi's prototype to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:38 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/rv770_dpm.c:62:30: warning: no previous prototype for 
> ‘evergreen_get_pi’ [-Wmissing-prototypes]
>  62 | struct evergreen_power_info *evergreen_get_pi(struct radeon_device 
> *rdev)
>  | ^~~~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/btc_dpm.c | 3 +--
>  drivers/gpu/drm/radeon/cypress_dpm.c | 3 +--
>  drivers/gpu/drm/radeon/evergreen.h   | 2 ++
>  drivers/gpu/drm/radeon/ni_dpm.c  | 3 +--
>  drivers/gpu/drm/radeon/rv770_dpm.c   | 1 +
>  drivers/gpu/drm/radeon/si_dpm.c  | 3 +--
>  6 files changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/btc_dpm.c 
> b/drivers/gpu/drm/radeon/btc_dpm.c
> index 018949668536e..4e64ed38c439f 100644
> --- a/drivers/gpu/drm/radeon/btc_dpm.c
> +++ b/drivers/gpu/drm/radeon/btc_dpm.c
> @@ -29,6 +29,7 @@
>  #include "btc_dpm.h"
>  #include "btcd.h"
>  #include "cypress_dpm.h"
> +#include "evergreen.h"
>  #include "r600_dpm.h"
>  #include "rv770.h"
>  #include "radeon.h"
> @@ -49,8 +50,6 @@
>  #ifndef BTC_MGCG_SEQUENCE
>  #define BTC_MGCG_SEQUENCE  300
>
> -struct evergreen_power_info *evergreen_get_pi(struct radeon_device *rdev);
> -
>  extern int ni_mc_load_microcode(struct radeon_device *rdev);
>
>  //* BARTS **//
> diff --git a/drivers/gpu/drm/radeon/cypress_dpm.c 
> b/drivers/gpu/drm/radeon/cypress_dpm.c
> index 6d3690bcca2d2..fdddbbaecbb74 100644
> --- a/drivers/gpu/drm/radeon/cypress_dpm.c
> +++ b/drivers/gpu/drm/radeon/cypress_dpm.c
> @@ -26,6 +26,7 @@
>
>  #include "atom.h"
>  #include "cypress_dpm.h"
> +#include "evergreen.h"
>  #include "evergreend.h"
>  #include "r600_dpm.h"
>  #include "rv770.h"
> @@ -44,8 +45,6 @@
>  #define MC_CG_SEQ_YCLK_SUSPEND  0x04
>  #define MC_CG_SEQ_YCLK_RESUME   0x0a
>
> -struct evergreen_power_info *evergreen_get_pi(struct radeon_device *rdev);
> -
>  static void cypress_enable_bif_dynamic_pcie_gen2(struct radeon_device *rdev,
>  bool enable)
>  {
> diff --git a/drivers/gpu/drm/radeon/evergreen.h 
> b/drivers/gpu/drm/radeon/evergreen.h
> index f8d772e612a48..a829deb8b078a 100644
> --- a/drivers/gpu/drm/radeon/evergreen.h
> +++ b/drivers/gpu/drm/radeon/evergreen.h
> @@ -29,6 +29,7 @@
>  #define __RADEON_EVERGREEN_H__
>
>  struct evergreen_mc_save;
> +struct evergreen_power_info;
>  struct radeon_device;
>
>  bool evergreen_is_display_hung(struct radeon_device *rdev);
> @@ -49,5 +50,6 @@ u32 evergreen_get_number_of_dram_channels(struct 
> radeon_device *rdev);
>  void evergreen_print_gpu_status_regs(struct radeon_device *rdev);
>  u32 evergreen_gpu_check_soft_reset(struct radeon_device *rdev);
>  int evergreen_rlc_resume(struct radeon_device *rdev);
> +struct evergreen_power_info *evergreen_get_pi(struct radeon_device *rdev);
>
>  #endif /* __RADEON_EVERGREEN_H__ */
> diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c
> index d39bbd9793cc2..dd5ef64937230 100644
> --- a/drivers/gpu/drm/radeon/ni_dpm.c
> +++ b/drivers/gpu/drm/radeon/ni_dpm.c
> @@ -26,6 +26,7 @@
>  #include 
>
>  #include "atom.h"
> +#include "evergreen.h"
>  #include "ni_dpm.h"
>  #include "nid.h"
>  #include "r600_dpm.h"
> @@ -720,8 +721,6 @@ static const u32 cayman_sysls_enable[] =
>  };
>  #define CAYMAN_SYSLS_ENABLE_LENGTH sizeof(cayman_sysls_enable) / (3 * 
> sizeof(u32))
>
> -struct evergreen_power_info *evergreen_get_pi(struct radeon_device *rdev);
> -
>  extern int ni_mc_load_microcode(struct radeon_device *rdev);
>
>  struct ni_power_info *ni_get_pi(struct radeon_device *rdev)
> diff --git a/drivers/gpu/drm/radeon/rv770_dpm.c 
> b/drivers/gpu/drm/radeon/rv770_dpm.c
> index badd8ac6e038f..ef2f1a048cfed 100644
> --- a/drivers/gpu/drm/radeon/rv770_dpm.c
> +++ b/drivers/gpu/drm/radeon/rv770_dpm.c
> @@ -30,6 +30,7 @@
>  #include "rv770_dpm.h"
>  #include "cypress_dpm.h"
>  #include "atom.h"
> +#include "evergreen.h"
>  #include 
>
>  #define MC_CG_ARB_FREQ_F0   0x0a
> diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c
> index 32b697965c064..b4581392fbce9 100644
> --- a/drivers/gpu/drm/radeon/si_dpm.c
> +++ b/drivers/gpu/drm/radeon/si_dpm.c
> @@ -26,6 +26,7 @@
>  #include 
>
>  #include "atom.h"
> +#include "evergreen.h"
>  #include "r600_dpm.h"
>  #include "rv770.h"
>  #include "radeon.h"
> @@ -1720,8 +1721,6 @@ static const struct si_powertune_data 
> powertune_data_hainan =
> true
>  };
>
> -struct evergreen_power_info *evergreen_get_pi(struct radeon_device *rdev);
> -
>  extern void vce_v1_0_enable_mgcg(struct radeon_device *rdev, bool enable);
>
>  static int si_populate_voltage_value(struct radeon_device *rdev,
> --

Re: [PATCH 31/43] drm/radeon/cik: Move 'si_*()'s prototypes to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:38 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/si.c:4186:6: warning: no previous prototype for 
> ‘si_vram_gtt_location’ [-Wmissing-prototypes]
>  4186 | void si_vram_gtt_location(struct radeon_device *rdev,
>  | ^~~~
>  drivers/gpu/drm/radeon/si.c:5186:6: warning: no previous prototype for 
> ‘si_init_uvd_internal_cg’ [-Wmissing-prototypes]
>  5186 | void si_init_uvd_internal_cg(struct radeon_device *rdev)
>  | ^~~
>  drivers/gpu/drm/radeon/si.c:5801:6: warning: no previous prototype for 
> ‘si_rlc_reset’ [-Wmissing-prototypes]
>  5801 | void si_rlc_reset(struct radeon_device *rdev)
>  | ^~~~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/cik.c | 4 +---
>  drivers/gpu/drm/radeon/si.h  | 4 
>  2 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
> index ae020ad7b3185..cef0f3111cd3a 100644
> --- a/drivers/gpu/drm/radeon/cik.c
> +++ b/drivers/gpu/drm/radeon/cik.c
> @@ -40,6 +40,7 @@
>  #include "radeon_asic.h"
>  #include "radeon_audio.h"
>  #include "radeon_ucode.h"
> +#include "si.h"
>
>  #define SH_MEM_CONFIG_GFX_DEFAULT \
> ALIGNMENT_MODE(SH_MEM_ALIGNMENT_MODE_UNALIGNED)
> @@ -127,9 +128,6 @@ MODULE_FIRMWARE("radeon/mullins_mec.bin");
>  MODULE_FIRMWARE("radeon/mullins_rlc.bin");
>  MODULE_FIRMWARE("radeon/mullins_sdma.bin");
>
> -extern void si_vram_gtt_location(struct radeon_device *rdev, struct 
> radeon_mc *mc);
> -extern void si_rlc_reset(struct radeon_device *rdev);
> -extern void si_init_uvd_internal_cg(struct radeon_device *rdev);
>  static u32 cik_get_cu_active_bitmap(struct radeon_device *rdev, u32 se, u32 
> sh);
>  extern int cik_sdma_resume(struct radeon_device *rdev);
>  extern void cik_sdma_enable(struct radeon_device *rdev, bool enable);
> diff --git a/drivers/gpu/drm/radeon/si.h b/drivers/gpu/drm/radeon/si.h
> index a1751ae560f02..f483a64d17050 100644
> --- a/drivers/gpu/drm/radeon/si.h
> +++ b/drivers/gpu/drm/radeon/si.h
> @@ -25,8 +25,12 @@
>  #define __SI_H__
>
>  struct radeon_device;
> +struct radeon_mc;
>
>  int si_mc_load_microcode(struct radeon_device *rdev);
>  u32 si_gpu_check_soft_reset(struct radeon_device *rdev);
> +void si_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc);
> +void si_rlc_reset(struct radeon_device *rdev);
> +void si_init_uvd_internal_cg(struct radeon_device *rdev);
>
>  #endif /* __SI_H__ */
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 30/43] drm/radeon/si_dma: Move 'si_gpu_check_soft_reset()'s prototype to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:38 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/si.c:3768:5: warning: no previous prototype for 
> ‘si_gpu_check_soft_reset’ [-Wmissing-prototypes]
>  3768 | u32 si_gpu_check_soft_reset(struct radeon_device *rdev)
>  | ^~~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/si.h | 1 +
>  drivers/gpu/drm/radeon/si_dma.c | 3 +--
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/si.h b/drivers/gpu/drm/radeon/si.h
> index 0a5018ef166e2..a1751ae560f02 100644
> --- a/drivers/gpu/drm/radeon/si.h
> +++ b/drivers/gpu/drm/radeon/si.h
> @@ -27,5 +27,6 @@
>  struct radeon_device;
>
>  int si_mc_load_microcode(struct radeon_device *rdev);
> +u32 si_gpu_check_soft_reset(struct radeon_device *rdev);
>
>  #endif /* __SI_H__ */
> diff --git a/drivers/gpu/drm/radeon/si_dma.c b/drivers/gpu/drm/radeon/si_dma.c
> index d2fa302a5be9f..645897d1bfc31 100644
> --- a/drivers/gpu/drm/radeon/si_dma.c
> +++ b/drivers/gpu/drm/radeon/si_dma.c
> @@ -25,10 +25,9 @@
>  #include "radeon.h"
>  #include "radeon_asic.h"
>  #include "radeon_trace.h"
> +#include "si.h"
>  #include "sid.h"
>
> -u32 si_gpu_check_soft_reset(struct radeon_device *rdev);
> -
>  /**
>   * si_dma_is_lockup - Check if the DMA engine is locked up
>   *
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 29/43] drm/radeon/si_dpm: Move 'si_mc_load_microcode()'s prototype to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:38 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/si.c:1570:5: warning: no previous prototype for 
> ‘si_mc_load_microcode’ [-Wmissing-prototypes]
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/si.c |  1 +
>  drivers/gpu/drm/radeon/si.h | 31 +++
>  drivers/gpu/drm/radeon/si_dpm.c |  2 +-
>  3 files changed, 33 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/gpu/drm/radeon/si.h
>
> diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
> index d0407145c07b5..88731b79c8f57 100644
> --- a/drivers/gpu/drm/radeon/si.c
> +++ b/drivers/gpu/drm/radeon/si.c
> @@ -39,6 +39,7 @@
>  #include "radeon_audio.h"
>  #include "radeon_ucode.h"
>  #include "si_blit_shaders.h"
> +#include "si.h"
>  #include "sid.h"
>
>
> diff --git a/drivers/gpu/drm/radeon/si.h b/drivers/gpu/drm/radeon/si.h
> new file mode 100644
> index 0..0a5018ef166e2
> --- /dev/null
> +++ b/drivers/gpu/drm/radeon/si.h
> @@ -0,0 +1,31 @@
> +/* si.h -- Private header for radeon driver -*- linux-c -*-
> + *
> + * Copyright 2011 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice shall be included in
> + * all copies or substantial portions of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> + * OTHER DEALINGS IN THE SOFTWARE.
> + */
> +
> +#ifndef __SI_H__
> +#define __SI_H__
> +
> +struct radeon_device;
> +
> +int si_mc_load_microcode(struct radeon_device *rdev);
> +
> +#endif /* __SI_H__ */
> diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c
> index c68ab2fb1ac23..32b697965c064 100644
> --- a/drivers/gpu/drm/radeon/si_dpm.c
> +++ b/drivers/gpu/drm/radeon/si_dpm.c
> @@ -32,6 +32,7 @@
>  #include "radeon_asic.h"
>  #include "ni_dpm.h"
>  #include "si_dpm.h"
> +#include "si.h"
>  #include "sid.h"
>
>  #define MC_CG_ARB_FREQ_F0   0x0a
> @@ -1721,7 +1722,6 @@ static const struct si_powertune_data 
> powertune_data_hainan =
>
>  struct evergreen_power_info *evergreen_get_pi(struct radeon_device *rdev);
>
> -extern int si_mc_load_microcode(struct radeon_device *rdev);
>  extern void vce_v1_0_enable_mgcg(struct radeon_device *rdev, bool enable);
>
>  static int si_populate_voltage_value(struct radeon_device *rdev,
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 28/43] drm/radeon/ci_dpm: Move 'ci_*()'s prototypes to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:38 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/cik.c:1868:5: warning: no previous prototype for 
> ‘ci_mc_load_microcode’ [-Wmissing-prototypes]
>  1868 | int ci_mc_load_microcode(struct radeon_device *rdev)
>  | ^~~~
>  drivers/gpu/drm/radeon/cik.c:5847:6: warning: no previous prototype for 
> ‘cik_enter_rlc_safe_mode’ [-Wmissing-prototypes]
>  5847 | void cik_enter_rlc_safe_mode(struct radeon_device *rdev)
>  | ^~~
>  drivers/gpu/drm/radeon/cik.c:5868:6: warning: no previous prototype for 
> ‘cik_exit_rlc_safe_mode’ [-Wmissing-prototypes]
>  5868 | void cik_exit_rlc_safe_mode(struct radeon_device *rdev)
>  | ^~
>  drivers/gpu/drm/radeon/cik.c:6286:6: warning: no previous prototype for 
> ‘cik_update_cg’ [-Wmissing-prototypes]
>  6286 | void cik_update_cg(struct radeon_device *rdev,
>  | ^
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/ci_dpm.c |  7 +--
>  drivers/gpu/drm/radeon/cik.c|  1 +
>  drivers/gpu/drm/radeon/cik.h| 33 +
>  3 files changed, 35 insertions(+), 6 deletions(-)
>  create mode 100644 drivers/gpu/drm/radeon/cik.h
>
> diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c
> index 8324aca5fd006..a9fc0a552736c 100644
> --- a/drivers/gpu/drm/radeon/ci_dpm.c
> +++ b/drivers/gpu/drm/radeon/ci_dpm.c
> @@ -27,6 +27,7 @@
>
>  #include "atom.h"
>  #include "ci_dpm.h"
> +#include "cik.h"
>  #include "cikd.h"
>  #include "r600_dpm.h"
>  #include "radeon.h"
> @@ -157,12 +158,6 @@ extern u8 si_get_mclk_frequency_ratio(u32 memory_clock, 
> bool strobe_mode);
>  extern void si_trim_voltage_table_to_fit_state_table(struct radeon_device 
> *rdev,
>  u32 max_voltage_steps,
>  struct 
> atom_voltage_table *voltage_table);
> -extern void cik_enter_rlc_safe_mode(struct radeon_device *rdev);
> -extern void cik_exit_rlc_safe_mode(struct radeon_device *rdev);
> -extern int ci_mc_load_microcode(struct radeon_device *rdev);
> -extern void cik_update_cg(struct radeon_device *rdev,
> - u32 block, bool enable);
> -
>  static int ci_get_std_voltage_value_sidd(struct radeon_device *rdev,
>  struct atom_voltage_table_entry 
> *voltage_table,
>  u16 *std_voltage_hi_sidd, u16 
> *std_voltage_lo_sidd);
> diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
> index 980b50d046cbc..ae020ad7b3185 100644
> --- a/drivers/gpu/drm/radeon/cik.c
> +++ b/drivers/gpu/drm/radeon/cik.c
> @@ -32,6 +32,7 @@
>  #include "atom.h"
>  #include "evergreen.h"
>  #include "cik_blit_shaders.h"
> +#include "cik.h"
>  #include "cikd.h"
>  #include "clearstate_ci.h"
>  #include "r600.h"
> diff --git a/drivers/gpu/drm/radeon/cik.h b/drivers/gpu/drm/radeon/cik.h
> new file mode 100644
> index 0..297b3c1ff804f
> --- /dev/null
> +++ b/drivers/gpu/drm/radeon/cik.h
> @@ -0,0 +1,33 @@
> +/* cik.h -- Private header for radeon driver -*- linux-c -*-
> + * Copyright 2012 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice shall be included in
> + * all copies or substantial portions of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> + * OTHER DEALINGS IN THE SOFTWARE.
> + */
> +
> +#ifndef __CIK_H__
> +#define __CIK_H__
> +
> +struct radeon_device;
> +
> +void cik_enter_rlc_safe_mode(struct radeon_device *rdev);
> +void cik_exit_rlc_safe_mode(struct radeon_device *rdev);
> +int ci_mc_load_microcode(struct radeon_device *rdev);
> +void cik_update_cg(struct radeon_device *rdev, u32 block, bool enable);
> +
> +#endif /* __CIK_H__ */
> --
> 2.25.1

Re: [PATCH 27/43] drm/radeon/radeon_encoders: Move 'radeon_atom_backlight_init's prototype to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:37 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/atombios_encoders.c:186:6: warning: no previous 
> prototype for ‘radeon_atom_backlight_init’ [-Wmissing-prototypes]
>  186 | void radeon_atom_backlight_init(struct radeon_encoder *radeon_encoder,
>  | ^~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/radeon_atombios.h | 4 
>  drivers/gpu/drm/radeon/radeon_encoders.c | 6 +-
>  2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_atombios.h 
> b/drivers/gpu/drm/radeon/radeon_atombios.h
> index a895a7002c3d3..fd03755e6fa2c 100644
> --- a/drivers/gpu/drm/radeon/radeon_atombios.h
> +++ b/drivers/gpu/drm/radeon/radeon_atombios.h
> @@ -28,14 +28,18 @@
>  #ifndef __RADEON_ATOMBIOS_H__
>  #define __RADEON_ATOMBIOS_H__
>
> +struct drm_connector;
>  struct drm_device;
>  struct drm_display_mode;
>  struct radeon_device;
> +struct radeon_encoder;
>
>  bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index,
> struct drm_display_mode *mode);
>  void radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_enum,
>  uint32_t supported_device, u16 caps);
> +void radeon_atom_backlight_init(struct radeon_encoder *radeon_encoder,
> +   struct drm_connector *drm_connector);
>
>
>  #endif /* __RADEON_ATOMBIOS_H__ */
> diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c 
> b/drivers/gpu/drm/radeon/radeon_encoders.c
> index b60a373d3ead3..46549d5179ee9 100644
> --- a/drivers/gpu/drm/radeon/radeon_encoders.c
> +++ b/drivers/gpu/drm/radeon/radeon_encoders.c
> @@ -31,14 +31,10 @@
>  #include 
>
>  #include "radeon.h"
> +#include "radeon_atombios.h"
>  #include "radeon_legacy_encoders.h"
>  #include "atom.h"
>
> -extern void
> -radeon_atom_backlight_init(struct radeon_encoder *radeon_encoder,
> -  struct drm_connector *drm_connector);
> -
> -
>  static uint32_t radeon_encoder_clones(struct drm_encoder *encoder)
>  {
> struct drm_device *dev = encoder->dev;
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 26/43] drm/radeon/radeon_atombios: Move 'radeon_add_atom_encoder()'s prototype to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:38 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/atombios_encoders.c:2721:1: warning: no previous 
> prototype for ‘radeon_add_atom_encoder’ [-Wmissing-prototypes]
>  2721 | radeon_add_atom_encoder(struct drm_device *dev,
>  | ^~~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/radeon_atombios.c | 4 
>  drivers/gpu/drm/radeon/radeon_atombios.h | 4 
>  2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c 
> b/drivers/gpu/drm/radeon/radeon_atombios.c
> index cc80651b25773..be96d9b64e43b 100644
> --- a/drivers/gpu/drm/radeon/radeon_atombios.c
> +++ b/drivers/gpu/drm/radeon/radeon_atombios.c
> @@ -37,10 +37,6 @@
>  #include "radeon_atombios.h"
>  #include "radeon_legacy_encoders.h"
>
> -extern void
> -radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_enum,
> -   uint32_t supported_device, u16 caps);
> -
>  union atom_supported_devices {
> struct _ATOM_SUPPORTED_DEVICES_INFO info;
> struct _ATOM_SUPPORTED_DEVICES_INFO_2 info_2;
> diff --git a/drivers/gpu/drm/radeon/radeon_atombios.h 
> b/drivers/gpu/drm/radeon/radeon_atombios.h
> index b7c76920feb7d..a895a7002c3d3 100644
> --- a/drivers/gpu/drm/radeon/radeon_atombios.h
> +++ b/drivers/gpu/drm/radeon/radeon_atombios.h
> @@ -28,10 +28,14 @@
>  #ifndef __RADEON_ATOMBIOS_H__
>  #define __RADEON_ATOMBIOS_H__
>
> +struct drm_device;
>  struct drm_display_mode;
>  struct radeon_device;
>
>  bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index,
> struct drm_display_mode *mode);
> +void radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_enum,
> +uint32_t supported_device, u16 caps);
> +
>
>  #endif /* __RADEON_ATOMBIOS_H__ */
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 25/43] drm/radeon/ni_dma: Move 'cayman_gpu_check_soft_reset()'s prototype to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:37 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/ni.c:1733:5: warning: no previous prototype for 
> ‘cayman_gpu_check_soft_reset’ [-Wmissing-prototypes]
>  1733 | u32 cayman_gpu_check_soft_reset(struct radeon_device *rdev)
>  | ^~~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/ni.h | 1 +
>  drivers/gpu/drm/radeon/ni_dma.c | 3 +--
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/ni.h b/drivers/gpu/drm/radeon/ni.h
> index d63be1c88c0f1..9a5f31a05e68f 100644
> --- a/drivers/gpu/drm/radeon/ni.h
> +++ b/drivers/gpu/drm/radeon/ni.h
> @@ -34,5 +34,6 @@ void cayman_cp_int_cntl_setup(struct radeon_device *rdev,
>   int ring, u32 cp_int_cntl);
>  void cayman_vm_decode_fault(struct radeon_device *rdev,
> u32 status, u32 addr);
> +u32 cayman_gpu_check_soft_reset(struct radeon_device *rdev);
>
>  #endif /* __NI_H__ */
> diff --git a/drivers/gpu/drm/radeon/ni_dma.c b/drivers/gpu/drm/radeon/ni_dma.c
> index c56136848360e..bd515ad4fe4cc 100644
> --- a/drivers/gpu/drm/radeon/ni_dma.c
> +++ b/drivers/gpu/drm/radeon/ni_dma.c
> @@ -25,10 +25,9 @@
>  #include "radeon.h"
>  #include "radeon_asic.h"
>  #include "radeon_trace.h"
> +#include "ni.h"
>  #include "nid.h"
>
> -u32 cayman_gpu_check_soft_reset(struct radeon_device *rdev);
> -
>  /*
>   * DMA
>   * Starting with R600, the GPU has an asynchronous
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 24/43] drm/radeon/r600: Move 'evergreen_rlc_resume()'s prototype to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:38 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/evergreen.c:4380:5: warning: no previous prototype 
> for ‘evergreen_rlc_resume’ [-Wmissing-prototypes]
>  4380 | int evergreen_rlc_resume(struct radeon_device *rdev)
>  | ^~~~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/evergreen.h | 1 +
>  drivers/gpu/drm/radeon/r600.c  | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/evergreen.h 
> b/drivers/gpu/drm/radeon/evergreen.h
> index eb46ac7776951..f8d772e612a48 100644
> --- a/drivers/gpu/drm/radeon/evergreen.h
> +++ b/drivers/gpu/drm/radeon/evergreen.h
> @@ -48,5 +48,6 @@ void evergreen_gpu_pci_config_reset(struct radeon_device 
> *rdev);
>  u32 evergreen_get_number_of_dram_channels(struct radeon_device *rdev);
>  void evergreen_print_gpu_status_regs(struct radeon_device *rdev);
>  u32 evergreen_gpu_check_soft_reset(struct radeon_device *rdev);
> +int evergreen_rlc_resume(struct radeon_device *rdev);
>
>  #endif /* __RADEON_EVERGREEN_H__ */
> diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
> index 94e8815e5067d..b44e0c607b1b1 100644
> --- a/drivers/gpu/drm/radeon/r600.c
> +++ b/drivers/gpu/drm/radeon/r600.c
> @@ -39,6 +39,7 @@
>
>  #include "atom.h"
>  #include "avivod.h"
> +#include "evergreen.h"
>  #include "r600.h"
>  #include "r600d.h"
>  #include "rv770.h"
> @@ -113,7 +114,6 @@ static void r600_gpu_init(struct radeon_device *rdev);
>  void r600_fini(struct radeon_device *rdev);
>  void r600_irq_disable(struct radeon_device *rdev);
>  static void r600_pcie_gen2_enable(struct radeon_device *rdev);
> -extern int evergreen_rlc_resume(struct radeon_device *rdev);
>
>  /*
>   * Indirect registers accessor
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 23/43] drm/radeon/evergreen_dma: Move 'evergreen_gpu_check_soft_reset()'s prototype to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:38 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/evergreen.c:3825:5: warning: no previous prototype 
> for ‘evergreen_gpu_check_soft_reset’ [-Wmissing-prototypes]
>  3825 | u32 evergreen_gpu_check_soft_reset(struct radeon_device *rdev)
>  | ^~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/evergreen.h | 1 +
>  drivers/gpu/drm/radeon/evergreen_dma.c | 3 +--
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/evergreen.h 
> b/drivers/gpu/drm/radeon/evergreen.h
> index 30c9ca99ced90..eb46ac7776951 100644
> --- a/drivers/gpu/drm/radeon/evergreen.h
> +++ b/drivers/gpu/drm/radeon/evergreen.h
> @@ -47,5 +47,6 @@ int sumo_rlc_init(struct radeon_device *rdev);
>  void evergreen_gpu_pci_config_reset(struct radeon_device *rdev);
>  u32 evergreen_get_number_of_dram_channels(struct radeon_device *rdev);
>  void evergreen_print_gpu_status_regs(struct radeon_device *rdev);
> +u32 evergreen_gpu_check_soft_reset(struct radeon_device *rdev);
>
>  #endif /* __RADEON_EVERGREEN_H__ */
> diff --git a/drivers/gpu/drm/radeon/evergreen_dma.c 
> b/drivers/gpu/drm/radeon/evergreen_dma.c
> index 767857d4a8c5c..52c79da1ecf57 100644
> --- a/drivers/gpu/drm/radeon/evergreen_dma.c
> +++ b/drivers/gpu/drm/radeon/evergreen_dma.c
> @@ -24,10 +24,9 @@
>
>  #include "radeon.h"
>  #include "radeon_asic.h"
> +#include "evergreen.h"
>  #include "evergreend.h"
>
> -u32 evergreen_gpu_check_soft_reset(struct radeon_device *rdev);
> -
>  /**
>   * evergreen_dma_fence_ring_emit - emit a fence on the DMA ring
>   *
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 22/43] drm/radeon/cik: Move 'r600_ih_ring_{alloc, fini}()'s prototypes to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:38 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/r600.c:3480:5: warning: no previous prototype for 
> ‘r600_ih_ring_alloc’ [-Wmissing-prototypes]
>  3480 | int r600_ih_ring_alloc(struct radeon_device *rdev)
>  | ^~
>  drivers/gpu/drm/radeon/r600.c:3516:6: warning: no previous prototype for 
> ‘r600_ih_ring_fini’ [-Wmissing-prototypes]
>  3516 | void r600_ih_ring_fini(struct radeon_device *rdev)
>  | ^
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/cik.c  | 3 +--
>  drivers/gpu/drm/radeon/r600.h | 2 ++
>  drivers/gpu/drm/radeon/si.c   | 3 +--
>  3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
> index 315c4f3df3656..980b50d046cbc 100644
> --- a/drivers/gpu/drm/radeon/cik.c
> +++ b/drivers/gpu/drm/radeon/cik.c
> @@ -34,6 +34,7 @@
>  #include "cik_blit_shaders.h"
>  #include "cikd.h"
>  #include "clearstate_ci.h"
> +#include "r600.h"
>  #include "radeon.h"
>  #include "radeon_asic.h"
>  #include "radeon_audio.h"
> @@ -125,8 +126,6 @@ MODULE_FIRMWARE("radeon/mullins_mec.bin");
>  MODULE_FIRMWARE("radeon/mullins_rlc.bin");
>  MODULE_FIRMWARE("radeon/mullins_sdma.bin");
>
> -extern int r600_ih_ring_alloc(struct radeon_device *rdev);
> -extern void r600_ih_ring_fini(struct radeon_device *rdev);
>  extern void si_vram_gtt_location(struct radeon_device *rdev, struct 
> radeon_mc *mc);
>  extern void si_rlc_reset(struct radeon_device *rdev);
>  extern void si_init_uvd_internal_cg(struct radeon_device *rdev);
> diff --git a/drivers/gpu/drm/radeon/r600.h b/drivers/gpu/drm/radeon/r600.h
> index 2a3915f0039e4..e66ef58706cd8 100644
> --- a/drivers/gpu/drm/radeon/r600.h
> +++ b/drivers/gpu/drm/radeon/r600.h
> @@ -31,5 +31,7 @@
>  struct radeon_device;
>
>  u32 r600_gpu_check_soft_reset(struct radeon_device *rdev);
> +int r600_ih_ring_alloc(struct radeon_device *rdev);
> +void r600_ih_ring_fini(struct radeon_device *rdev);
>
>  #endif /* __R600_H__ */
> diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
> index 45076c27d7ded..d0407145c07b5 100644
> --- a/drivers/gpu/drm/radeon/si.c
> +++ b/drivers/gpu/drm/radeon/si.c
> @@ -33,6 +33,7 @@
>  #include "atom.h"
>  #include "clearstate_si.h"
>  #include "evergreen.h"
> +#include "r600.h"
>  #include "radeon.h"
>  #include "radeon_asic.h"
>  #include "radeon_audio.h"
> @@ -128,8 +129,6 @@ static void si_pcie_gen3_enable(struct radeon_device 
> *rdev);
>  static void si_program_aspm(struct radeon_device *rdev);
>  extern void sumo_rlc_fini(struct radeon_device *rdev);
>  extern int sumo_rlc_init(struct radeon_device *rdev);
> -extern int r600_ih_ring_alloc(struct radeon_device *rdev);
> -extern void r600_ih_ring_fini(struct radeon_device *rdev);
>  static void si_enable_gui_idle_interrupt(struct radeon_device *rdev,
>  bool enable);
>  static void si_init_pg(struct radeon_device *rdev);
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 21/43] drm/radeon/r600_dma: Move 'r600_gpu_check_soft_reset()'s prototype to shared location

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:38 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/r600.c:1615:5: warning: no previous prototype for 
> ‘r600_gpu_check_soft_reset’ [-Wmissing-prototypes]
>  1615 | u32 r600_gpu_check_soft_reset(struct radeon_device *rdev)
>  | ^
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied with minor changes.  Thanks!

Alex


> ---
>  drivers/gpu/drm/radeon/r600.c |  1 +
>  drivers/gpu/drm/radeon/r600.h | 35 +++
>  drivers/gpu/drm/radeon/r600_dma.c |  3 +--
>  3 files changed, 37 insertions(+), 2 deletions(-)
>  create mode 100644 drivers/gpu/drm/radeon/r600.h
>
> diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
> index f09b6dc5cbeb3..94e8815e5067d 100644
> --- a/drivers/gpu/drm/radeon/r600.c
> +++ b/drivers/gpu/drm/radeon/r600.c
> @@ -39,6 +39,7 @@
>
>  #include "atom.h"
>  #include "avivod.h"
> +#include "r600.h"
>  #include "r600d.h"
>  #include "rv770.h"
>  #include "radeon.h"
> diff --git a/drivers/gpu/drm/radeon/r600.h b/drivers/gpu/drm/radeon/r600.h
> new file mode 100644
> index 0..2a3915f0039e4
> --- /dev/null
> +++ b/drivers/gpu/drm/radeon/r600.h
> @@ -0,0 +1,35 @@
> +/* r600.h -- Private header for radeon driver -*- linux-c -*-
> + *
> + * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
> + * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
> + * All rights reserved.
> + *
> + * 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
> OTHER
> + * DEALINGS IN THE SOFTWARE.
> + *
> + */
> +
> +#ifndef __R600_H__
> +#define __R600_H__
> +
> +struct radeon_device;
> +
> +u32 r600_gpu_check_soft_reset(struct radeon_device *rdev);
> +
> +#endif /* __R600_H__ */
> diff --git a/drivers/gpu/drm/radeon/r600_dma.c 
> b/drivers/gpu/drm/radeon/r600_dma.c
> index af6c0da45f28a..89ca2738c5d4c 100644
> --- a/drivers/gpu/drm/radeon/r600_dma.c
> +++ b/drivers/gpu/drm/radeon/r600_dma.c
> @@ -24,10 +24,9 @@
>
>  #include "radeon.h"
>  #include "radeon_asic.h"
> +#include "r600.h"
>  #include "r600d.h"
>
> -u32 r600_gpu_check_soft_reset(struct radeon_device *rdev);
> -
>  /*
>   * DMA
>   * Starting with R600, the GPU has an asynchronous
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 20/43] drm/radeon/evergreen: Move 'cayman_*()'s prototypes to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:38 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/ni.c:1378:6: warning: no previous prototype for 
> ‘cayman_cp_int_cntl_setup’ [-Wmissing-prototypes]
>  1378 | void cayman_cp_int_cntl_setup(struct radeon_device *rdev,
>  | ^~~~
>  drivers/gpu/drm/radeon/ni.c:1732:5: warning: no previous prototype for 
> ‘cayman_gpu_check_soft_reset’ [-Wmissing-prototypes]
>  1732 | u32 cayman_gpu_check_soft_reset(struct radeon_device *rdev)
>  | ^~~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied with minor changes.  Thanks!

Alex


> ---
>  drivers/gpu/drm/radeon/evergreen.c |  5 +---
>  drivers/gpu/drm/radeon/ni.c|  1 +
>  drivers/gpu/drm/radeon/ni.h| 38 ++
>  3 files changed, 40 insertions(+), 4 deletions(-)
>  create mode 100644 drivers/gpu/drm/radeon/ni.h
>
> diff --git a/drivers/gpu/drm/radeon/evergreen.c 
> b/drivers/gpu/drm/radeon/evergreen.c
> index f860f5ef2df88..8fb0b8c3db5b5 100644
> --- a/drivers/gpu/drm/radeon/evergreen.c
> +++ b/drivers/gpu/drm/radeon/evergreen.c
> @@ -31,6 +31,7 @@
>
>  #include "atom.h"
>  #include "avivod.h"
> +#include "ni.h"
>  #include "rv770.h"
>  #include "evergreen.h"
>  #include "evergreen_blit_shaders.h"
> @@ -215,10 +216,6 @@ static void evergreen_gpu_init(struct radeon_device 
> *rdev);
>  void evergreen_fini(struct radeon_device *rdev);
>  void evergreen_pcie_gen2_enable(struct radeon_device *rdev);
>  void evergreen_program_aspm(struct radeon_device *rdev);
> -extern void cayman_cp_int_cntl_setup(struct radeon_device *rdev,
> -int ring, u32 cp_int_cntl);
> -extern void cayman_vm_decode_fault(struct radeon_device *rdev,
> -  u32 status, u32 addr);
>  void cik_init_cp_pg_table(struct radeon_device *rdev);
>
>  extern u32 si_get_csb_size(struct radeon_device *rdev);
> diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
> index 1c9030a4631b8..ab7bd30802176 100644
> --- a/drivers/gpu/drm/radeon/ni.c
> +++ b/drivers/gpu/drm/radeon/ni.c
> @@ -33,6 +33,7 @@
>  #include "cayman_blit_shaders.h"
>  #include "clearstate_cayman.h"
>  #include "evergreen.h"
> +#include "ni.h"
>  #include "ni_reg.h"
>  #include "nid.h"
>  #include "radeon.h"
> diff --git a/drivers/gpu/drm/radeon/ni.h b/drivers/gpu/drm/radeon/ni.h
> new file mode 100644
> index 0..d63be1c88c0f1
> --- /dev/null
> +++ b/drivers/gpu/drm/radeon/ni.h
> @@ -0,0 +1,38 @@
> +/* ni.h -- Private header for radeon driver -*- linux-c -*-
> + *
> + * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
> + * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
> + * All rights reserved.
> + *
> + * 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
> OTHER
> + * DEALINGS IN THE SOFTWARE.
> + *
> + */
> +
> +#ifndef __NI_H__
> +#define __NI_H__
> +
> +struct radeon_device;
> +
> +void cayman_cp_int_cntl_setup(struct radeon_device *rdev,
> + int ring, u32 cp_int_cntl);
> +void cayman_vm_decode_fault(struct radeon_device *rdev,
> +   u32 status, u32 addr);
> +
> +#endif /* __NI_H__ */
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 19/43] drm/radeon/ni_dpm: Move 'ni_get_{pi, ps}()'s into shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:38 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/ni_dpm.c:727:23: warning: no previous prototype for 
> ‘ni_get_pi’ [-Wmissing-prototypes]
>  727 | struct ni_power_info *ni_get_pi(struct radeon_device *rdev)
>  | ^
>  drivers/gpu/drm/radeon/ni_dpm.c:734:15: warning: no previous prototype for 
> ‘ni_get_ps’ [-Wmissing-prototypes]
>  734 | struct ni_ps *ni_get_ps(struct radeon_ps *rps)
>  | ^
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/ni_dpm.h | 3 +++
>  drivers/gpu/drm/radeon/si_dpm.c | 3 +--
>  2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/ni_dpm.h b/drivers/gpu/drm/radeon/ni_dpm.h
> index 6bbee9180909e..74e3019369063 100644
> --- a/drivers/gpu/drm/radeon/ni_dpm.h
> +++ b/drivers/gpu/drm/radeon/ni_dpm.h
> @@ -247,4 +247,7 @@ void ni_set_uvd_clock_after_set_eng_clock(struct 
> radeon_device *rdev,
>
>  bool ni_dpm_vblank_too_short(struct radeon_device *rdev);
>
> +struct ni_power_info *ni_get_pi(struct radeon_device *rdev);
> +struct ni_ps *ni_get_ps(struct radeon_ps *rps);
> +
>  #endif
> diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c
> index a80a21447a76d..c68ab2fb1ac23 100644
> --- a/drivers/gpu/drm/radeon/si_dpm.c
> +++ b/drivers/gpu/drm/radeon/si_dpm.c
> @@ -30,6 +30,7 @@
>  #include "rv770.h"
>  #include "radeon.h"
>  #include "radeon_asic.h"
> +#include "ni_dpm.h"
>  #include "si_dpm.h"
>  #include "sid.h"
>
> @@ -1719,8 +1720,6 @@ static const struct si_powertune_data 
> powertune_data_hainan =
>  };
>
>  struct evergreen_power_info *evergreen_get_pi(struct radeon_device *rdev);
> -struct ni_power_info *ni_get_pi(struct radeon_device *rdev);
> -struct ni_ps *ni_get_ps(struct radeon_ps *rps);
>
>  extern int si_mc_load_microcode(struct radeon_device *rdev);
>  extern void vce_v1_0_enable_mgcg(struct radeon_device *rdev, bool enable);
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 4/7] drm/radeon: Pin buffers while they are vmap'ed

2020-11-16 Thread Thomas Zimmermann
Hi

Am 16.11.20 um 12:28 schrieb Christian König:
> Am 13.11.20 um 08:59 schrieb Thomas Zimmermann:
>> Hi Christian
>>
>> Am 12.11.20 um 18:16 schrieb Christian König:
>>> Am 12.11.20 um 14:21 schrieb Thomas Zimmermann:
 In order to avoid eviction of vmap'ed buffers, pin them in their GEM
 object's vmap implementation. Unpin them in the vunmap implementation.
 This is needed to make generic fbdev support work reliably. Without,
 the buffer object could be evicted while fbdev flushed its shadow
 buffer.

 In difference to the PRIME pin/unpin functions, the vmap code does not
 modify the BOs prime_shared_count, so a vmap-pinned BO does not
 count as
 shared.

 The actual pin location is not important as the vmap call returns
 information on how to access the buffer. Callers that require a
 specific location should explicitly pin the BO before vmapping it.
>>> Well is the buffer supposed to be scanned out?
>> No, not by the fbdev helper.
> 
> Ok in this case that should work.
> 
>>> If yes then the pin location is actually rather important since the
>>> hardware can only scan out from VRAM.
>> For relocatable BOs, fbdev uses a shadow buffer that makes all any
>> relocation transparent to userspace. It flushes the shadow fb into the
>> BO's memory if there are updates. The code is in
>> drm_fb_helper_dirty_work(). [1] During the flush operation, the vmap
>> call now pins the BO to wherever it is. The actual location does not
>> matter. It's vunmap'ed immediately afterwards.
> 
> The problem is what happens when it is prepared for scanout, but can't
> be moved to VRAM because it is vmapped?
> 
> When the shadow is never scanned out that isn't a problem, but we need
> to keep that in mind.

I sent out a patchset that addresses the issue in it's final patch. [1]
I'd appreciate your feedback. It also tested the patches with the
converted radeon driver.

Best regards
Thomas

[1] https://patchwork.freedesktop.org/series/83918/

> 
> Regards,
> Christian.
> 
>>
>> For dma-buf sharing, the regular procedure of pin + vmap still apply.
>> This should always move the BO into GTT-managed memory.
>>
>> Best regards
>> Thomas
>>
>> [1]
>> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.kernel.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Ftorvalds%2Flinux.git%2Ftree%2Fdrivers%2Fgpu%2Fdrm%2Fdrm_fb_helper.c%23n432data=04%7C01%7Cchristian.koenig%40amd.com%7C31b890664ca7429fc45808d887aa0842%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637408511650629569%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=RLauuAuXkcl0rXwWWJ%2FrKP%2BsCr2wAzU1ejGV1bnQ80w%3Dreserved=0
>>
>>
>>> Regards,
>>> Christian.
>>>
 Signed-off-by: Thomas Zimmermann 
 ---
    drivers/gpu/drm/radeon/radeon_gem.c | 51
 +++--
    1 file changed, 49 insertions(+), 2 deletions(-)

 diff --git a/drivers/gpu/drm/radeon/radeon_gem.c
 b/drivers/gpu/drm/radeon/radeon_gem.c
 index d2876ce3bc9e..eaf7fc9a7b07 100644
 --- a/drivers/gpu/drm/radeon/radeon_gem.c
 +++ b/drivers/gpu/drm/radeon/radeon_gem.c
 @@ -226,6 +226,53 @@ static int radeon_gem_handle_lockup(struct
 radeon_device *rdev, int r)
    return r;
    }
    +static int radeon_gem_object_vmap(struct drm_gem_object *obj,
 struct dma_buf_map *map)
 +{
 +    static const uint32_t any_domain = RADEON_GEM_DOMAIN_VRAM |
 +   RADEON_GEM_DOMAIN_GTT |
 +   RADEON_GEM_DOMAIN_CPU;
 +
 +    struct radeon_bo *bo = gem_to_radeon_bo(obj);
 +    int ret;
 +
 +    ret = radeon_bo_reserve(bo, false);
 +    if (ret)
 +    return ret;
 +
 +    /* pin buffer at its current location */
 +    ret = radeon_bo_pin(bo, any_domain, NULL);
 +    if (ret)
 +    goto err_radeon_bo_unreserve;
 +
 +    ret = drm_gem_ttm_vmap(obj, map);
 +    if (ret)
 +    goto err_radeon_bo_unpin;
 +
 +    radeon_bo_unreserve(bo);
 +
 +    return 0;
 +
 +err_radeon_bo_unpin:
 +    radeon_bo_unpin(bo);
 +err_radeon_bo_unreserve:
 +    radeon_bo_unreserve(bo);
 +    return ret;
 +}
 +
 +static void radeon_gem_object_vunmap(struct drm_gem_object *obj,
 struct dma_buf_map *map)
 +{
 +    struct radeon_bo *bo = gem_to_radeon_bo(obj);
 +    int ret;
 +
 +    ret = radeon_bo_reserve(bo, false);
 +    if (ret)
 +    return;
 +
 +    drm_gem_ttm_vunmap(obj, map);
 +    radeon_bo_unpin(bo);
 +    radeon_bo_unreserve(bo);
 +}
 +
    static const struct drm_gem_object_funcs radeon_gem_object_funcs = {
    .free = radeon_gem_object_free,
    .open = radeon_gem_object_open,
 @@ -234,8 +281,8 @@ static const struct drm_gem_object_funcs
 radeon_gem_object_funcs = {
    .pin = 

Re: [PATCH 18/43] drm/radeon/rv770: Move 'rv770_get_*()'s prototypes to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:37 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/rv770_dpm.c:47:18: warning: no previous prototype for 
> ‘rv770_get_ps’ [-Wmissing-prototypes]
>  47 | struct rv7xx_ps *rv770_get_ps(struct radeon_ps *rps)
>  | ^~~~
>  drivers/gpu/drm/radeon/rv770_dpm.c:54:26: warning: no previous prototype for 
> ‘rv770_get_pi’ [-Wmissing-prototypes]
>  54 | struct rv7xx_power_info *rv770_get_pi(struct radeon_device *rdev)
>  | ^~~~
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex


> ---
>  drivers/gpu/drm/radeon/btc_dpm.c | 3 +--
>  drivers/gpu/drm/radeon/cypress_dpm.c | 3 +--
>  drivers/gpu/drm/radeon/ni_dpm.c  | 2 +-
>  drivers/gpu/drm/radeon/rv730_dpm.c   | 4 +---
>  drivers/gpu/drm/radeon/rv740_dpm.c   | 3 +--
>  drivers/gpu/drm/radeon/rv770.h   | 4 
>  drivers/gpu/drm/radeon/rv770_dpm.c   | 1 +
>  drivers/gpu/drm/radeon/si_dpm.c  | 2 +-
>  8 files changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/btc_dpm.c 
> b/drivers/gpu/drm/radeon/btc_dpm.c
> index d1d8aaf8323c2..018949668536e 100644
> --- a/drivers/gpu/drm/radeon/btc_dpm.c
> +++ b/drivers/gpu/drm/radeon/btc_dpm.c
> @@ -30,6 +30,7 @@
>  #include "btcd.h"
>  #include "cypress_dpm.h"
>  #include "r600_dpm.h"
> +#include "rv770.h"
>  #include "radeon.h"
>  #include "radeon_asic.h"
>
> @@ -48,8 +49,6 @@
>  #ifndef BTC_MGCG_SEQUENCE
>  #define BTC_MGCG_SEQUENCE  300
>
> -struct rv7xx_ps *rv770_get_ps(struct radeon_ps *rps);
> -struct rv7xx_power_info *rv770_get_pi(struct radeon_device *rdev);
>  struct evergreen_power_info *evergreen_get_pi(struct radeon_device *rdev);
>
>  extern int ni_mc_load_microcode(struct radeon_device *rdev);
> diff --git a/drivers/gpu/drm/radeon/cypress_dpm.c 
> b/drivers/gpu/drm/radeon/cypress_dpm.c
> index 35b177d777913..6d3690bcca2d2 100644
> --- a/drivers/gpu/drm/radeon/cypress_dpm.c
> +++ b/drivers/gpu/drm/radeon/cypress_dpm.c
> @@ -28,6 +28,7 @@
>  #include "cypress_dpm.h"
>  #include "evergreend.h"
>  #include "r600_dpm.h"
> +#include "rv770.h"
>  #include "radeon.h"
>  #include "radeon_asic.h"
>
> @@ -43,8 +44,6 @@
>  #define MC_CG_SEQ_YCLK_SUSPEND  0x04
>  #define MC_CG_SEQ_YCLK_RESUME   0x0a
>
> -struct rv7xx_ps *rv770_get_ps(struct radeon_ps *rps);
> -struct rv7xx_power_info *rv770_get_pi(struct radeon_device *rdev);
>  struct evergreen_power_info *evergreen_get_pi(struct radeon_device *rdev);
>
>  static void cypress_enable_bif_dynamic_pcie_gen2(struct radeon_device *rdev,
> diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c
> index 59cdadcece159..d39bbd9793cc2 100644
> --- a/drivers/gpu/drm/radeon/ni_dpm.c
> +++ b/drivers/gpu/drm/radeon/ni_dpm.c
> @@ -29,6 +29,7 @@
>  #include "ni_dpm.h"
>  #include "nid.h"
>  #include "r600_dpm.h"
> +#include "rv770.h"
>  #include "radeon.h"
>  #include "radeon_asic.h"
>
> @@ -719,7 +720,6 @@ static const u32 cayman_sysls_enable[] =
>  };
>  #define CAYMAN_SYSLS_ENABLE_LENGTH sizeof(cayman_sysls_enable) / (3 * 
> sizeof(u32))
>
> -struct rv7xx_power_info *rv770_get_pi(struct radeon_device *rdev);
>  struct evergreen_power_info *evergreen_get_pi(struct radeon_device *rdev);
>
>  extern int ni_mc_load_microcode(struct radeon_device *rdev);
> diff --git a/drivers/gpu/drm/radeon/rv730_dpm.c 
> b/drivers/gpu/drm/radeon/rv730_dpm.c
> index 84a3d6d724866..a9de5c953396a 100644
> --- a/drivers/gpu/drm/radeon/rv730_dpm.c
> +++ b/drivers/gpu/drm/radeon/rv730_dpm.c
> @@ -25,6 +25,7 @@
>  #include "radeon.h"
>  #include "rv730d.h"
>  #include "r600_dpm.h"
> +#include "rv770.h"
>  #include "rv770_dpm.h"
>  #include "atom.h"
>
> @@ -33,9 +34,6 @@
>  #define MC_CG_ARB_FREQ_F2   0x0c
>  #define MC_CG_ARB_FREQ_F3   0x0d
>
> -struct rv7xx_ps *rv770_get_ps(struct radeon_ps *rps);
> -struct rv7xx_power_info *rv770_get_pi(struct radeon_device *rdev);
> -
>  int rv730_populate_sclk_value(struct radeon_device *rdev,
>   u32 engine_clock,
>   RV770_SMC_SCLK_VALUE *sclk)
> diff --git a/drivers/gpu/drm/radeon/rv740_dpm.c 
> b/drivers/gpu/drm/radeon/rv740_dpm.c
> index 327d65a76e1f4..d57a3e1df8d63 100644
> --- a/drivers/gpu/drm/radeon/rv740_dpm.c
> +++ b/drivers/gpu/drm/radeon/rv740_dpm.c
> @@ -25,11 +25,10 @@
>  #include "radeon.h"
>  #include "rv740d.h"
>  #include "r600_dpm.h"
> +#include "rv770.h"
>  #include "rv770_dpm.h"
>  #include "atom.h"
>
> -struct rv7xx_power_info *rv770_get_pi(struct radeon_device *rdev);
> -
>  u32 rv740_get_decoded_reference_divider(u32 encoded_ref)
>  {
> u32 ref = 0;
> diff --git a/drivers/gpu/drm/radeon/rv770.h b/drivers/gpu/drm/radeon/rv770.h
> index a3f2bb44979fe..0e15916d0a948 100644
> --- a/drivers/gpu/drm/radeon/rv770.h
> +++ 

Re: [PATCH 17/43] drm/radeon/evergreen_hdmi: Move 'evergreen_*()' and 'dce4_*()' HDMI prototypes to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:37 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/evergreen_hdmi.c:37:6: warning: no previous prototype 
> for ‘dce4_audio_enable’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/evergreen_hdmi.c:67:6: warning: no previous prototype 
> for ‘evergreen_hdmi_update_acr’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/evergreen_hdmi.c:97:6: warning: no previous prototype 
> for ‘dce4_afmt_write_latency_fields’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/evergreen_hdmi.c:119:6: warning: no previous 
> prototype for ‘dce4_afmt_hdmi_write_speaker_allocation’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/evergreen_hdmi.c:137:6: warning: no previous 
> prototype for ‘dce4_afmt_dp_write_speaker_allocation’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/evergreen_hdmi.c:155:6: warning: no previous 
> prototype for ‘evergreen_hdmi_write_sad_regs’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/evergreen_hdmi.c:208:6: warning: no previous 
> prototype for ‘evergreen_set_avi_packet’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/evergreen_hdmi.c:227:6: warning: no previous 
> prototype for ‘dce4_hdmi_audio_set_dto’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/evergreen_hdmi.c:270:6: warning: no previous 
> prototype for ‘dce4_dp_audio_set_dto’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/evergreen_hdmi.c:306:6: warning: no previous 
> prototype for ‘dce4_set_vbi_packet’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/evergreen_hdmi.c:317:6: warning: no previous 
> prototype for ‘dce4_hdmi_set_color_depth’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/evergreen_hdmi.c:354:6: warning: no previous 
> prototype for ‘dce4_set_audio_packet’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/evergreen_hdmi.c:389:6: warning: no previous 
> prototype for ‘dce4_set_mute’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/evergreen_hdmi.c:400:6: warning: no previous 
> prototype for ‘evergreen_hdmi_enable’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/evergreen_hdmi.c:440:6: warning: no previous 
> prototype for ‘evergreen_dp_enable’ [-Wmissing-prototypes]
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied with minor changes.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/evergreen_hdmi.c |  1 +
>  drivers/gpu/drm/radeon/evergreen_hdmi.h | 69 +
>  drivers/gpu/drm/radeon/radeon_audio.c   | 26 +-
>  3 files changed, 71 insertions(+), 25 deletions(-)
>  create mode 100644 drivers/gpu/drm/radeon/evergreen_hdmi.h
>
> diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c 
> b/drivers/gpu/drm/radeon/evergreen_hdmi.c
> index 739336a48d085..5f3078f8ab950 100644
> --- a/drivers/gpu/drm/radeon/evergreen_hdmi.c
> +++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c
> @@ -27,6 +27,7 @@
>  #include 
>
>  #include 
> +#include "evergreen_hdmi.h"
>  #include "radeon.h"
>  #include "radeon_asic.h"
>  #include "radeon_audio.h"
> diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.h 
> b/drivers/gpu/drm/radeon/evergreen_hdmi.h
> new file mode 100644
> index 0..c86276b8d7f58
> --- /dev/null
> +++ b/drivers/gpu/drm/radeon/evergreen_hdmi.h
> @@ -0,0 +1,69 @@
> +/* evergreen_hdmi.h -- Private header for radeon driver -*- linux-c -*-
> + *
> + * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
> + * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
> + * All rights reserved.
> + *
> + * 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
> OTHER
> + * DEALINGS IN THE SOFTWARE.
> + *
> + */
> +
> +#ifndef __EVERGREEN_HDMI_H__
> +#define __EVERGREEN_HDMI_H__
> +
> +struct cea_sa;
> +struct cea_sad;
> +struct drm_connector;
> +struct drm_display_mode;
> +struct drm_encoder;
> +struct r600_audio_pin;

Re: [PATCH 16/43] drm/radeon/radeon_gem: Move 'radeon_gem_prime_*()'s prototypes to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:37 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_prime.c:34:18: warning: no previous prototype 
> for ‘radeon_gem_prime_get_sg_table’ [-Wmissing-prototypes]
>  34 | struct sg_table *radeon_gem_prime_get_sg_table(struct drm_gem_object 
> *obj)
>  | ^
>  drivers/gpu/drm/radeon/radeon_prime.c:42:7: warning: no previous prototype 
> for ‘radeon_gem_prime_vmap’ [-Wmissing-prototypes]
>  42 | void *radeon_gem_prime_vmap(struct drm_gem_object *obj)
>  | ^
>  drivers/gpu/drm/radeon/radeon_prime.c:55:6: warning: no previous prototype 
> for ‘radeon_gem_prime_vunmap’ [-Wmissing-prototypes]
>  55 | void radeon_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr)
>  | ^~~
>  drivers/gpu/drm/radeon/radeon_prime.c:62:24: warning: no previous prototype 
> for ‘radeon_gem_prime_import_sg_table’ [-Wmissing-prototypes]
>  62 | struct drm_gem_object *radeon_gem_prime_import_sg_table(struct 
> drm_device *dev,
>  | ^~~~
>  drivers/gpu/drm/radeon/radeon_prime.c:86:5: warning: no previous prototype 
> for ‘radeon_gem_prime_pin’ [-Wmissing-prototypes]
>  86 | int radeon_gem_prime_pin(struct drm_gem_object *obj)
>  | ^~~~
>  drivers/gpu/drm/radeon/radeon_prime.c:104:6: warning: no previous prototype 
> for ‘radeon_gem_prime_unpin’ [-Wmissing-prototypes]
>  104 | void radeon_gem_prime_unpin(struct drm_gem_object *obj)
>  | ^~
>  drivers/gpu/drm/radeon/radeon_prime.c:120:17: warning: no previous prototype 
> for ‘radeon_gem_prime_export’ [-Wmissing-prototypes]
>  120 | struct dma_buf *radeon_gem_prime_export(struct drm_gem_object *gobj,
>  | ^~~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied with minor changes.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/radeon_gem.c   |  1 +
>  drivers/gpu/drm/radeon/radeon_prime.c |  1 +
>  drivers/gpu/drm/radeon/radeon_prime.h | 39 +++
>  3 files changed, 41 insertions(+)
>  create mode 100644 drivers/gpu/drm/radeon/radeon_prime.h
>
> diff --git a/drivers/gpu/drm/radeon/radeon_gem.c 
> b/drivers/gpu/drm/radeon/radeon_gem.c
> index d2876ce3bc9e2..b6b21d2e72624 100644
> --- a/drivers/gpu/drm/radeon/radeon_gem.c
> +++ b/drivers/gpu/drm/radeon/radeon_gem.c
> @@ -35,6 +35,7 @@
>  #include 
>
>  #include "radeon.h"
> +#include "radeon_prime.h"
>
>  struct dma_buf *radeon_gem_prime_export(struct drm_gem_object *gobj,
> int flags);
> diff --git a/drivers/gpu/drm/radeon/radeon_prime.c 
> b/drivers/gpu/drm/radeon/radeon_prime.c
> index 088d39a51c0d2..dd482edc819c5 100644
> --- a/drivers/gpu/drm/radeon/radeon_prime.c
> +++ b/drivers/gpu/drm/radeon/radeon_prime.c
> @@ -30,6 +30,7 @@
>  #include 
>
>  #include "radeon.h"
> +#include "radeon_prime.h"
>
>  struct sg_table *radeon_gem_prime_get_sg_table(struct drm_gem_object *obj)
>  {
> diff --git a/drivers/gpu/drm/radeon/radeon_prime.h 
> b/drivers/gpu/drm/radeon/radeon_prime.h
> new file mode 100644
> index 0..11b7f80987834
> --- /dev/null
> +++ b/drivers/gpu/drm/radeon/radeon_prime.h
> @@ -0,0 +1,39 @@
> +/* radeon_prime.h -- Private header for radeon driver -*- linux-c -*-
> + *
> + * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
> + * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
> + * All rights reserved.
> + *
> + * 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
> OTHER
> + * DEALINGS IN THE SOFTWARE.
> + *
> + */
> +
> +#ifndef __RADEON_PRIME_H__
> +#define __RADEON_PRIME_H__
> +
> +struct dma_buf *radeon_gem_prime_export(struct drm_gem_object *gobj,
> +   int 

Re: [PATCH 15/43] drm/radeon/atom: Move 'radeon_atom_hw_i2c_*()'s prototypes into shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:37 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/atombios_i2c.c:100:5: warning: no previous prototype 
> for ‘radeon_atom_hw_i2c_xfer’ [-Wmissing-prototypes]
>  100 | int radeon_atom_hw_i2c_xfer(struct i2c_adapter *i2c_adap,
>  | ^~~
>  drivers/gpu/drm/radeon/atombios_i2c.c:150:5: warning: no previous prototype 
> for ‘radeon_atom_hw_i2c_func’ [-Wmissing-prototypes]
>  150 | u32 radeon_atom_hw_i2c_func(struct i2c_adapter *adap)
>  | ^~~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/atom.h   | 7 +++
>  drivers/gpu/drm/radeon/radeon_i2c.c | 4 
>  2 files changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/atom.h b/drivers/gpu/drm/radeon/atom.h
> index 1bf06c91cd959..5de0563b63d2e 100644
> --- a/drivers/gpu/drm/radeon/atom.h
> +++ b/drivers/gpu/drm/radeon/atom.h
> @@ -154,6 +154,13 @@ bool atom_parse_data_header(struct atom_context *ctx, 
> int index, uint16_t *size,
>  bool atom_parse_cmd_header(struct atom_context *ctx, int index,
>uint8_t *frev, uint8_t *crev);
>  int atom_allocate_fb_scratch(struct atom_context *ctx);
> +
> +struct i2c_msg;
> +struct i2c_adapter;
> +int radeon_atom_hw_i2c_xfer(struct i2c_adapter *i2c_adap,
> +   struct i2c_msg *msgs, int num);
> +u32 radeon_atom_hw_i2c_func(struct i2c_adapter *adap);
> +
>  #include "atom-types.h"
>  #include "atombios.h"
>  #include "ObjectID.h"
> diff --git a/drivers/gpu/drm/radeon/radeon_i2c.c 
> b/drivers/gpu/drm/radeon/radeon_i2c.c
> index aa61b3cb4049c..e543d993f73ee 100644
> --- a/drivers/gpu/drm/radeon/radeon_i2c.c
> +++ b/drivers/gpu/drm/radeon/radeon_i2c.c
> @@ -34,10 +34,6 @@
>  #include "radeon.h"
>  #include "atom.h"
>
> -extern int radeon_atom_hw_i2c_xfer(struct i2c_adapter *i2c_adap,
> -  struct i2c_msg *msgs, int num);
> -extern u32 radeon_atom_hw_i2c_func(struct i2c_adapter *adap);
> -
>  bool radeon_ddc_probe(struct radeon_connector *radeon_connector, bool 
> use_aux)
>  {
> u8 out = 0x0;
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 14/43] drm/radeon/radeon_drv: Move 'radeon_driver_irq_handler_kms's prototype into shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:37 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_irq_kms.c:53:13: warning: no previous 
> prototype for ‘radeon_driver_irq_handler_kms’ [-Wmissing-prototypes]
>  53 | irqreturn_t radeon_driver_irq_handler_kms(int irq, void *arg)
>  | ^
>  drivers/gpu/drm/radeon/radeon_irq_kms.c:120:6: warning: no previous 
> prototype for ‘radeon_driver_irq_preinstall_kms’ [-Wmissing-prototypes]
>  120 | void radeon_driver_irq_preinstall_kms(struct drm_device *dev)
>  | ^~~~
>  drivers/gpu/drm/radeon/radeon_irq_kms.c:152:5: warning: no previous 
> prototype for ‘radeon_driver_irq_postinstall_kms’ [-Wmissing-prototypes]
>  152 | int radeon_driver_irq_postinstall_kms(struct drm_device *dev)
>  | ^
>  drivers/gpu/drm/radeon/radeon_irq_kms.c:171:6: warning: no previous 
> prototype for ‘radeon_driver_irq_uninstall_kms’ [-Wmissing-prototypes]
>  171 | void radeon_driver_irq_uninstall_kms(struct drm_device *dev)
>  | ^~~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Gareth Hughes 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/radeon_drv.c | 5 +
>  drivers/gpu/drm/radeon/radeon_irq_kms.c | 1 +
>  drivers/gpu/drm/radeon/radeon_kms.h | 5 +
>  3 files changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c 
> b/drivers/gpu/drm/radeon/radeon_drv.c
> index 2b9deaead99b2..211932d73b191 100644
> --- a/drivers/gpu/drm/radeon/radeon_drv.c
> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
> @@ -51,6 +51,7 @@
>  #include 
>
>  #include "radeon_drv.h"
> +#include "radeon_kms.h"
>  #include "radeon_ttm.h"
>  #include "radeon.h"
>  #include "radeon_device.h"
> @@ -117,10 +118,6 @@
>  int radeon_suspend_kms(struct drm_device *dev, bool suspend,
>bool fbcon, bool freeze);
>  int radeon_resume_kms(struct drm_device *dev, bool resume, bool fbcon);
> -void radeon_driver_irq_preinstall_kms(struct drm_device *dev);
> -int radeon_driver_irq_postinstall_kms(struct drm_device *dev);
> -void radeon_driver_irq_uninstall_kms(struct drm_device *dev);
> -irqreturn_t radeon_driver_irq_handler_kms(int irq, void *arg);
>  extern int radeon_get_crtc_scanoutpos(struct drm_device *dev, unsigned int 
> crtc,
>   unsigned int flags, int *vpos, int 
> *hpos,
>   ktime_t *stime, ktime_t *etime,
> diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c 
> b/drivers/gpu/drm/radeon/radeon_irq_kms.c
> index a242b6053d47e..b8b7f627f0a9c 100644
> --- a/drivers/gpu/drm/radeon/radeon_irq_kms.c
> +++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c
> @@ -38,6 +38,7 @@
>
>  #include "atom.h"
>  #include "radeon.h"
> +#include "radeon_kms.h"
>  #include "radeon_reg.h"
>
>
> diff --git a/drivers/gpu/drm/radeon/radeon_kms.h 
> b/drivers/gpu/drm/radeon/radeon_kms.h
> index 36e73cea92154..913c8239d5d8d 100644
> --- a/drivers/gpu/drm/radeon/radeon_kms.h
> +++ b/drivers/gpu/drm/radeon/radeon_kms.h
> @@ -32,4 +32,9 @@ u32 radeon_get_vblank_counter_kms(struct drm_crtc *crtc);
>  int radeon_enable_vblank_kms(struct drm_crtc *crtc);
>  void radeon_disable_vblank_kms(struct drm_crtc *crtc);
>
> +irqreturn_t radeon_driver_irq_handler_kms(int irq, void *arg);
> +void radeon_driver_irq_preinstall_kms(struct drm_device *dev);
> +int radeon_driver_irq_postinstall_kms(struct drm_device *dev);
> +void radeon_driver_irq_uninstall_kms(struct drm_device *dev);
> +
>  #endif /* __RADEON_KMS_H__ */
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 13/43] drm/radeon/radeon_drv: Move 'radeon_mmap()'s prototype to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:37 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_ttm.c:931:5: warning: no previous prototype 
> for ‘radeon_mmap’ [-Wmissing-prototypes]
>  931 | int radeon_mmap(struct file *filp, struct vm_area_struct *vma)
>  | ^~~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Gareth Hughes 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/radeon_drv.c | 2 +-
>  drivers/gpu/drm/radeon/radeon_ttm.h | 1 +
>  2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c 
> b/drivers/gpu/drm/radeon/radeon_drv.c
> index 536b246b9a6aa..2b9deaead99b2 100644
> --- a/drivers/gpu/drm/radeon/radeon_drv.c
> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
> @@ -51,6 +51,7 @@
>  #include 
>
>  #include "radeon_drv.h"
> +#include "radeon_ttm.h"
>  #include "radeon.h"
>  #include "radeon_device.h"
>
> @@ -125,7 +126,6 @@ extern int radeon_get_crtc_scanoutpos(struct drm_device 
> *dev, unsigned int crtc,
>   ktime_t *stime, ktime_t *etime,
>   const struct drm_display_mode *mode);
>  extern bool radeon_is_px(struct drm_device *dev);
> -int radeon_mmap(struct file *filp, struct vm_area_struct *vma);
>  int radeon_mode_dumb_mmap(struct drm_file *filp,
>   struct drm_device *dev,
>   uint32_t handle, uint64_t *offset_p);
> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.h 
> b/drivers/gpu/drm/radeon/radeon_ttm.h
> index 91ea7141bc812..4d7b90ee27740 100644
> --- a/drivers/gpu/drm/radeon/radeon_ttm.h
> +++ b/drivers/gpu/drm/radeon/radeon_ttm.h
> @@ -32,5 +32,6 @@ struct radeon_device;
>
>  int radeon_ttm_init(struct radeon_device *rdev);
>  void radeon_ttm_fini(struct radeon_device *rdev);
> +int radeon_mmap(struct file *filp, struct vm_area_struct *vma);
>
>  #endif /* __RADEON_TTM_H__ */
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 12/43] drm/radeon/evergreen: Move 'evergreen_*' and 'sumo_*' prototypes out to shared location

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:30 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/evergreen.c:1281:6: warning: no previous prototype 
> for ‘evergreen_fix_pci_max_read_req_size’ [-Wmissing-prototypes]
>  1281 | void evergreen_fix_pci_max_read_req_size(struct radeon_device *rdev)
>  | ^~~
>  drivers/gpu/drm/radeon/evergreen.c:2664:6: warning: no previous prototype 
> for ‘evergreen_mc_stop’ [-Wmissing-prototypes]
>  2664 | void evergreen_mc_stop(struct radeon_device *rdev, struct 
> evergreen_mc_save *save)
>  | ^
>  drivers/gpu/drm/radeon/evergreen.c:2762:6: warning: no previous prototype 
> for ‘evergreen_mc_resume’ [-Wmissing-prototypes]
>  2762 | void evergreen_mc_resume(struct radeon_device *rdev, struct 
> evergreen_mc_save *save)
>  | ^~~
>  drivers/gpu/drm/radeon/evergreen.c:2850:6: warning: no previous prototype 
> for ‘evergreen_mc_program’ [-Wmissing-prototypes]
>  2850 | void evergreen_mc_program(struct radeon_device *rdev)
>  | ^~~~
>  drivers/gpu/drm/radeon/evergreen.c:3710:5: warning: no previous prototype 
> for ‘evergreen_mc_init’ [-Wmissing-prototypes]
>  3710 | int evergreen_mc_init(struct radeon_device *rdev)
>  | ^
>  drivers/gpu/drm/radeon/evergreen.c:3769:6: warning: no previous prototype 
> for ‘evergreen_print_gpu_status_regs’ [-Wmissing-prototypes]
>  3769 | void evergreen_print_gpu_status_regs(struct radeon_device *rdev)
>  | ^~~
>  drivers/gpu/drm/radeon/evergreen.c:3797:6: warning: no previous prototype 
> for ‘evergreen_is_display_hung’ [-Wmissing-prototypes]
>  3797 | bool evergreen_is_display_hung(struct radeon_device *rdev)
>  | ^
>  drivers/gpu/drm/radeon/evergreen.c:4009:6: warning: no previous prototype 
> for ‘evergreen_gpu_pci_config_reset’ [-Wmissing-prototypes]
>  4009 | void evergreen_gpu_pci_config_reset(struct radeon_device *rdev)
>  | ^~
>  drivers/gpu/drm/radeon/evergreen.c:4110:6: warning: no previous prototype 
> for ‘sumo_rlc_fini’ [-Wmissing-prototypes]
>  4110 | void sumo_rlc_fini(struct radeon_device *rdev)
>  | ^
>  drivers/gpu/drm/radeon/evergreen.c:4153:5: warning: no previous prototype 
> for ‘sumo_rlc_init’ [-Wmissing-prototypes]
>  4153 | int sumo_rlc_init(struct radeon_device *rdev)
>  | ^
>  drivers/gpu/drm/radeon/evergreen.c:4381:5: warning: no previous prototype 
> for ‘evergreen_rlc_resume’ [-Wmissing-prototypes]
>  4381 | int evergreen_rlc_resume(struct radeon_device *rdev)
>  | ^
>  drivers/gpu/drm/radeon/evergreen.c:4670:6: warning: no previous prototype 
> for ‘evergreen_irq_suspend’ [-Wmissing-prototypes]
>  4670 | void evergreen_irq_suspend(struct radeon_device *rdev)
>  | ^
>
> NB: Lots more of these - snipped for brevity
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied with minor changes.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/cik.c   |  6 +---
>  drivers/gpu/drm/radeon/evergreen.c |  1 +
>  drivers/gpu/drm/radeon/evergreen.h | 51 ++
>  drivers/gpu/drm/radeon/ni.c| 16 +-
>  drivers/gpu/drm/radeon/si.c|  7 +---
>  5 files changed, 55 insertions(+), 26 deletions(-)
>  create mode 100644 drivers/gpu/drm/radeon/evergreen.h
>
> diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
> index abf370e16bd9f..315c4f3df3656 100644
> --- a/drivers/gpu/drm/radeon/cik.c
> +++ b/drivers/gpu/drm/radeon/cik.c
> @@ -30,6 +30,7 @@
>  #include 
>
>  #include "atom.h"
> +#include "evergreen.h"
>  #include "cik_blit_shaders.h"
>  #include "cikd.h"
>  #include "clearstate_ci.h"
> @@ -126,11 +127,6 @@ MODULE_FIRMWARE("radeon/mullins_sdma.bin");
>
>  extern int r600_ih_ring_alloc(struct radeon_device *rdev);
>  extern void r600_ih_ring_fini(struct radeon_device *rdev);
> -extern void evergreen_mc_stop(struct radeon_device *rdev, struct 
> evergreen_mc_save *save);
> -extern void evergreen_mc_resume(struct radeon_device *rdev, struct 
> evergreen_mc_save *save);
> -extern bool evergreen_is_display_hung(struct radeon_device *rdev);
> -extern void sumo_rlc_fini(struct radeon_device *rdev);
> -extern int sumo_rlc_init(struct radeon_device *rdev);
>  extern void si_vram_gtt_location(struct radeon_device *rdev, struct 
> radeon_mc *mc);
>  extern void si_rlc_reset(struct radeon_device *rdev);
>  extern void si_init_uvd_internal_cg(struct radeon_device *rdev);
> diff --git a/drivers/gpu/drm/radeon/evergreen.c 
> b/drivers/gpu/drm/radeon/evergreen.c
> index 9a1e240b07234..f860f5ef2df88 100644
> --- a/drivers/gpu/drm/radeon/evergreen.c
> +++ b/drivers/gpu/drm/radeon/evergreen.c
> @@ -32,6 +32,7 @@
>  #include "atom.h"
>  #include "avivod.h"
>  #include "rv770.h"
> 

Re: [PATCH 11/43] drm/radeon/radeon_audio: Move 'dce3_2_*' prototypes to shared location

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:30 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/dce3_1_afmt.c:30:6: warning: no previous prototype 
> for ‘dce3_2_afmt_hdmi_write_speaker_allocation’ [-Wmissing-prototypes]
>  30 | void dce3_2_afmt_hdmi_write_speaker_allocation(struct drm_encoder 
> *encoder,
>  | ^
>  drivers/gpu/drm/radeon/dce3_1_afmt.c:48:6: warning: no previous prototype 
> for ‘dce3_2_afmt_dp_write_speaker_allocation’ [-Wmissing-prototypes]
>  48 | void dce3_2_afmt_dp_write_speaker_allocation(struct drm_encoder 
> *encoder,
>  | ^~~
>  drivers/gpu/drm/radeon/dce3_1_afmt.c:66:6: warning: no previous prototype 
> for ‘dce3_2_afmt_write_sad_regs’ [-Wmissing-prototypes]
>  66 | void dce3_2_afmt_write_sad_regs(struct drm_encoder *encoder,
>  | ^~
>  drivers/gpu/drm/radeon/dce3_1_afmt.c:116:6: warning: no previous prototype 
> for ‘dce3_2_audio_set_dto’ [-Wmissing-prototypes]
>  116 | void dce3_2_audio_set_dto(struct radeon_device *rdev,
>  | ^~~~
>  drivers/gpu/drm/radeon/dce3_1_afmt.c:170:6: warning: no previous prototype 
> for ‘dce3_2_hdmi_update_acr’ [-Wmissing-prototypes]
>  170 | void dce3_2_hdmi_update_acr(struct drm_encoder *encoder, long offset,
>  | ^~
>  drivers/gpu/drm/radeon/dce3_1_afmt.c:202:6: warning: no previous prototype 
> for ‘dce3_2_set_audio_packet’ [-Wmissing-prototypes]
>  202 | void dce3_2_set_audio_packet(struct drm_encoder *encoder, u32 offset)
>  | ^~~
>  drivers/gpu/drm/radeon/dce3_1_afmt.c:223:6: warning: no previous prototype 
> for ‘dce3_2_set_mute’ [-Wmissing-prototypes]
>  223 | void dce3_2_set_mute(struct drm_encoder *encoder, u32 offset, bool 
> mute)
>  | ^~~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Slava Grigorev 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/radeon_audio.c | 12 
>  drivers/gpu/drm/radeon/radeon_audio.h | 12 
>  2 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_audio.c 
> b/drivers/gpu/drm/radeon/radeon_audio.c
> index 8c63ccb8b6235..f6c783e19c988 100644
> --- a/drivers/gpu/drm/radeon/radeon_audio.c
> +++ b/drivers/gpu/drm/radeon/radeon_audio.c
> @@ -38,16 +38,10 @@ void dce6_audio_enable(struct radeon_device *rdev, struct 
> r600_audio_pin *pin,
>  u32 dce6_endpoint_rreg(struct radeon_device *rdev, u32 offset, u32 reg);
>  void dce6_endpoint_wreg(struct radeon_device *rdev,
> u32 offset, u32 reg, u32 v);
> -void dce3_2_afmt_write_sad_regs(struct drm_encoder *encoder,
> -   struct cea_sad *sads, int sad_count);
>  void evergreen_hdmi_write_sad_regs(struct drm_encoder *encoder,
> struct cea_sad *sads, int sad_count);
>  void dce6_afmt_write_sad_regs(struct drm_encoder *encoder,
> struct cea_sad *sads, int sad_count);
> -void dce3_2_afmt_hdmi_write_speaker_allocation(struct drm_encoder *encoder,
> -   u8 *sadb, int sad_count);
> -void dce3_2_afmt_dp_write_speaker_allocation(struct drm_encoder *encoder,
> -   u8 *sadb, int sad_count);
>  void dce4_afmt_hdmi_write_speaker_allocation(struct drm_encoder *encoder,
> u8 *sadb, int sad_count);
>  void dce4_afmt_dp_write_speaker_allocation(struct drm_encoder *encoder,
> @@ -65,8 +59,6 @@ struct r600_audio_pin* dce6_audio_get_pin(struct 
> radeon_device *rdev);
>  void dce6_afmt_select_pin(struct drm_encoder *encoder);
>  void r600_hdmi_audio_set_dto(struct radeon_device *rdev,
> struct radeon_crtc *crtc, unsigned int clock);
> -void dce3_2_audio_set_dto(struct radeon_device *rdev,
> -   struct radeon_crtc *crtc, unsigned int clock);
>  void dce4_hdmi_audio_set_dto(struct radeon_device *rdev,
> struct radeon_crtc *crtc, unsigned int clock);
>  void dce4_dp_audio_set_dto(struct radeon_device *rdev,
> @@ -81,8 +73,6 @@ void evergreen_set_avi_packet(struct radeon_device *rdev, 
> u32 offset,
> unsigned char *buffer, size_t size);
>  void r600_hdmi_update_acr(struct drm_encoder *encoder, long offset,
> const struct radeon_hdmi_acr *acr);
> -void dce3_2_hdmi_update_acr(struct drm_encoder *encoder, long offset,
> -   const struct radeon_hdmi_acr *acr);
>  void evergreen_hdmi_update_acr(struct drm_encoder *encoder, long offset,
> const struct radeon_hdmi_acr *acr);
>  void r600_set_vbi_packet(struct drm_encoder *encoder, u32 offset);
> @@ -90,10 +80,8 @@ void dce4_set_vbi_packet(struct drm_encoder *encoder, u32 
> offset);
>  void dce4_hdmi_set_color_depth(struct drm_encoder *encoder,
> u32 offset, int bpc);
>  void r600_set_audio_packet(struct drm_encoder *encoder, u32 offset);
> -void dce3_2_set_audio_packet(struct 

Re: [PATCH 10/43] drm/radeon/radeon_pm: Move 'radeon_pm_acpi_event_handler' prototype into shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:30 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_pm.c:74:6: warning: no previous prototype for 
> ‘radeon_pm_acpi_event_handler’ [-Wmissing-prototypes]
>  74 | void radeon_pm_acpi_event_handler(struct radeon_device *rdev)
>  | ^~~~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied with minor changes.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/radeon_acpi.c |  3 +--
>  drivers/gpu/drm/radeon/radeon_pm.c   |  1 +
>  drivers/gpu/drm/radeon/radeon_pm.h   | 33 
>  3 files changed, 35 insertions(+), 2 deletions(-)
>  create mode 100644 drivers/gpu/drm/radeon/radeon_pm.h
>
> diff --git a/drivers/gpu/drm/radeon/radeon_acpi.c 
> b/drivers/gpu/drm/radeon/radeon_acpi.c
> index 6cf1645e7a1a8..1baef7b493def 100644
> --- a/drivers/gpu/drm/radeon/radeon_acpi.c
> +++ b/drivers/gpu/drm/radeon/radeon_acpi.c
> @@ -36,6 +36,7 @@
>  #include "atom.h"
>  #include "radeon.h"
>  #include "radeon_acpi.h"
> +#include "radeon_pm.h"
>
>  #if defined(CONFIG_VGA_SWITCHEROO)
>  bool radeon_atpx_dgpu_req_power_for_displays(void);
> @@ -45,8 +46,6 @@ static inline bool 
> radeon_atpx_dgpu_req_power_for_displays(void) { return false;
>
>  #define ACPI_AC_CLASS   "ac_adapter"
>
> -extern void radeon_pm_acpi_event_handler(struct radeon_device *rdev);
> -
>  struct atif_verify_interface {
> u16 size;   /* structure size in bytes (includes size 
> field) */
> u16 version;/* version */
> diff --git a/drivers/gpu/drm/radeon/radeon_pm.c 
> b/drivers/gpu/drm/radeon/radeon_pm.c
> index 65d172b13e065..1995dad59dd09 100644
> --- a/drivers/gpu/drm/radeon/radeon_pm.c
> +++ b/drivers/gpu/drm/radeon/radeon_pm.c
> @@ -33,6 +33,7 @@
>  #include "avivod.h"
>  #include "r600_dpm.h"
>  #include "radeon.h"
> +#include "radeon_pm.h"
>
>  #define RADEON_IDLE_LOOP_MS 100
>  #define RADEON_RECLOCK_DELAY_MS 200
> diff --git a/drivers/gpu/drm/radeon/radeon_pm.h 
> b/drivers/gpu/drm/radeon/radeon_pm.h
> new file mode 100644
> index 0..5ef147785e815
> --- /dev/null
> +++ b/drivers/gpu/drm/radeon/radeon_pm.h
> @@ -0,0 +1,33 @@
> +/* radeon_pm.h -- Private header for radeon driver -*- linux-c -*-
> + *
> + * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
> + * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
> + * All rights reserved.
> + *
> + * 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
> OTHER
> + * DEALINGS IN THE SOFTWARE.
> + *
> + */
> +
> +#ifndef __RADEON_PM_H__
> +#define __RADEON_PM_H__
> +
> +void radeon_pm_acpi_event_handler(struct radeon_device *rdev);
> +
> +#endif /* __RADEON_PM_H__ */
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 09/43] drm/radeon/rv770: Move 'rv770_set_clk_bypass_mode' prototype to shared location

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:30 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/rv770.c:1138:6: warning: no previous prototype for 
> ‘rv770_set_clk_bypass_mode’ [-Wmissing-prototypes]
>  1138 | void rv770_set_clk_bypass_mode(struct radeon_device *rdev)
>  | ^
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied with minor changes.

Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/evergreen.c |  2 +-
>  drivers/gpu/drm/radeon/r600.c  |  2 +-
>  drivers/gpu/drm/radeon/rv770.c |  1 +
>  drivers/gpu/drm/radeon/rv770.h | 35 ++
>  4 files changed, 38 insertions(+), 2 deletions(-)
>  create mode 100644 drivers/gpu/drm/radeon/rv770.h
>
> diff --git a/drivers/gpu/drm/radeon/evergreen.c 
> b/drivers/gpu/drm/radeon/evergreen.c
> index 1f2acca437abd..9a1e240b07234 100644
> --- a/drivers/gpu/drm/radeon/evergreen.c
> +++ b/drivers/gpu/drm/radeon/evergreen.c
> @@ -31,6 +31,7 @@
>
>  #include "atom.h"
>  #include "avivod.h"
> +#include "rv770.h"
>  #include "evergreen_blit_shaders.h"
>  #include "evergreen_reg.h"
>  #include "evergreend.h"
> @@ -223,7 +224,6 @@ extern u32 si_get_csb_size(struct radeon_device *rdev);
>  extern void si_get_csb_buffer(struct radeon_device *rdev, volatile u32 
> *buffer);
>  extern u32 cik_get_csb_size(struct radeon_device *rdev);
>  extern void cik_get_csb_buffer(struct radeon_device *rdev, volatile u32 
> *buffer);
> -extern void rv770_set_clk_bypass_mode(struct radeon_device *rdev);
>
>  static const u32 evergreen_golden_registers[] =
>  {
> diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
> index 12a918335ac7b..f09b6dc5cbeb3 100644
> --- a/drivers/gpu/drm/radeon/r600.c
> +++ b/drivers/gpu/drm/radeon/r600.c
> @@ -40,6 +40,7 @@
>  #include "atom.h"
>  #include "avivod.h"
>  #include "r600d.h"
> +#include "rv770.h"
>  #include "radeon.h"
>  #include "radeon_asic.h"
>  #include "radeon_audio.h"
> @@ -112,7 +113,6 @@ void r600_fini(struct radeon_device *rdev);
>  void r600_irq_disable(struct radeon_device *rdev);
>  static void r600_pcie_gen2_enable(struct radeon_device *rdev);
>  extern int evergreen_rlc_resume(struct radeon_device *rdev);
> -extern void rv770_set_clk_bypass_mode(struct radeon_device *rdev);
>
>  /*
>   * Indirect registers accessor
> diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
> index 21f653ae1e1bb..88e29ebaad467 100644
> --- a/drivers/gpu/drm/radeon/rv770.c
> +++ b/drivers/gpu/drm/radeon/rv770.c
> @@ -39,6 +39,7 @@
>  #include "radeon_asic.h"
>  #include "radeon_audio.h"
>  #include "rv770d.h"
> +#include "rv770.h"
>
>  #define R700_PFP_UCODE_SIZE 848
>  #define R700_PM4_UCODE_SIZE 1360
> diff --git a/drivers/gpu/drm/radeon/rv770.h b/drivers/gpu/drm/radeon/rv770.h
> new file mode 100644
> index 0..a3f2bb44979fe
> --- /dev/null
> +++ b/drivers/gpu/drm/radeon/rv770.h
> @@ -0,0 +1,35 @@
> +/* radeon_rv770.h -- Private header for radeon driver -*- linux-c -*-
> + *
> + * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
> + * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
> + * All rights reserved.
> + *
> + * 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
> OTHER
> + * DEALINGS IN THE SOFTWARE.
> + *
> + */
> +
> +#ifndef __RADEON_RV770_H__
> +#define __RADEON_RV770_H__
> +
> +struct radeon_device;
> +
> +void rv770_set_clk_bypass_mode(struct radeon_device *rdev);
> +
> +#endif /* __RADEON_RV770_H__ */
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing 

Re: [PATCH 08/43] drm/radeon/radeon_irq_kms: Demote non-conformant kernel-doc fix another

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:30 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_irq_kms.c:56: warning: Function parameter or 
> member 'irq' not described in 'radeon_driver_irq_handler_kms'
>  drivers/gpu/drm/radeon/radeon_irq_kms.c:56: warning: Function parameter or 
> member 'arg' not described in 'radeon_driver_irq_handler_kms'
>  drivers/gpu/drm/radeon/radeon_irq_kms.c:571: warning: Function parameter or 
> member 'n' not described in 'radeon_irq_kms_set_irq_n_enabled'
>  drivers/gpu/drm/radeon/radeon_irq_kms.c:571: warning: Excess function 
> parameter 'num' description in 'radeon_irq_kms_set_irq_n_enabled'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex


> ---
>  drivers/gpu/drm/radeon/radeon_irq_kms.c | 8 +++-
>  1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c 
> b/drivers/gpu/drm/radeon/radeon_irq_kms.c
> index b86bc88ad4308..a242b6053d47e 100644
> --- a/drivers/gpu/drm/radeon/radeon_irq_kms.c
> +++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c
> @@ -43,11 +43,9 @@
>
>  #define RADEON_WAIT_IDLE_TIMEOUT 200
>
> -/**
> +/*
>   * radeon_driver_irq_handler_kms - irq handler for KMS
>   *
> - * @int irq, void *arg: args
> - *
>   * This is the irq handler for the radeon KMS driver (all asics).
>   * radeon_irq_process is a macro that points to the per-asic
>   * irq handler callback.
> @@ -549,14 +547,14 @@ void radeon_irq_kms_disable_hpd(struct radeon_device 
> *rdev, unsigned hpd_mask)
>  }
>
>  /**
> - * radeon_irq_kms_update_int_n - helper for updating interrupt enable 
> registers
> + * radeon_irq_kms_set_irq_n_enabled - helper for updating interrupt enable 
> registers
>   *
>   * @rdev: radeon device pointer
>   * @reg: the register to write to enable/disable interrupts
>   * @mask: the mask that enables the interrupts
>   * @enable: whether to enable or disable the interrupt register
>   * @name: the name of the interrupt register to print to the kernel log
> - * @num: the number of the interrupt register to print to the kernel log
> + * @n: the number of the interrupt register to print to the kernel log
>   *
>   * Helper for updating the enable state of interrupt registers. Checks 
> whether
>   * or not the interrupt matches the enable state we want. If it doesn't, then
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 07/43] drm/radeon/radeon_legacy_encoders: Move 'radeon_add_legacy_encoder's prototype to shared location

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:30 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_legacy_encoders.c:1746:1: warning: no previous 
> prototype for ‘radeon_add_legacy_encoder’ [-Wmissing-prototypes]
>  1746 | radeon_add_legacy_encoder(struct drm_device *dev, uint32_t 
> encoder_enum, uint32_t supported_device)
>  | ^
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/radeon_atombios.c| 6 +-
>  drivers/gpu/drm/radeon/radeon_combios.c | 6 +-
>  drivers/gpu/drm/radeon/radeon_legacy_encoders.h | 2 ++
>  3 files changed, 4 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c 
> b/drivers/gpu/drm/radeon/radeon_atombios.c
> index 71bf2ed172697..cc80651b25773 100644
> --- a/drivers/gpu/drm/radeon/radeon_atombios.c
> +++ b/drivers/gpu/drm/radeon/radeon_atombios.c
> @@ -35,16 +35,12 @@
>  #include "atom-bits.h"
>  #include "radeon_asic.h"
>  #include "radeon_atombios.h"
> +#include "radeon_legacy_encoders.h"
>
>  extern void
>  radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_enum,
> uint32_t supported_device, u16 caps);
>
> -/* from radeon_legacy_encoder.c */
> -extern void
> -radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_enum,
> - uint32_t supported_device);
> -
>  union atom_supported_devices {
> struct _ATOM_SUPPORTED_DEVICES_INFO info;
> struct _ATOM_SUPPORTED_DEVICES_INFO_2 info_2;
> diff --git a/drivers/gpu/drm/radeon/radeon_combios.c 
> b/drivers/gpu/drm/radeon/radeon_combios.c
> index d3c04df7e75d7..ff2135059c071 100644
> --- a/drivers/gpu/drm/radeon/radeon_combios.c
> +++ b/drivers/gpu/drm/radeon/radeon_combios.c
> @@ -31,6 +31,7 @@
>  #include 
>
>  #include "radeon.h"
> +#include "radeon_legacy_encoders.h"
>  #include "atom.h"
>
>  #ifdef CONFIG_PPC_PMAC
> @@ -40,11 +41,6 @@
>  #include 
>  #endif /* CONFIG_PPC_PMAC */
>
> -/* from radeon_legacy_encoder.c */
> -extern void
> -radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_enum,
> - uint32_t supported_device);
> -
>  /* old legacy ATI BIOS routines */
>
>  /* COMBIOS table offsets */
> diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.h 
> b/drivers/gpu/drm/radeon/radeon_legacy_encoders.h
> index a80b387559d4d..f4c7432267e67 100644
> --- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.h
> +++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.h
> @@ -30,5 +30,7 @@
>
>  void radeon_legacy_backlight_init(struct radeon_encoder *radeon_encoder,
>   struct drm_connector *drm_connector);
> +void radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_enum,
> +  uint32_t supported_device);
>
>  #endif /* __RADEON_LEGACY_ENCODERS_H__ */
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 06/43] drm/radeon/radeon_legacy_encoders: Move 'radeon_add_legacy_encoder' prototype to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:30 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>   drivers/gpu/drm/radeon/radeon_legacy_encoders.c:1745:1: warning: no 
> previous prototype for ‘radeon_add_legacy_encoder’ [-Wmissing-prototypes]
>  1745 | radeon_add_legacy_encoder(struct drm_device *dev, uint32_t 
> encoder_enum, uint32_t supported_device)
>  | ^
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/radeon_encoders.c  |  4 +--
>  .../gpu/drm/radeon/radeon_legacy_encoders.c   |  1 +
>  .../gpu/drm/radeon/radeon_legacy_encoders.h   | 34 +++
>  3 files changed, 36 insertions(+), 3 deletions(-)
>  create mode 100644 drivers/gpu/drm/radeon/radeon_legacy_encoders.h
>
> diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c 
> b/drivers/gpu/drm/radeon/radeon_encoders.c
> index ced022fae19d7..b60a373d3ead3 100644
> --- a/drivers/gpu/drm/radeon/radeon_encoders.c
> +++ b/drivers/gpu/drm/radeon/radeon_encoders.c
> @@ -31,11 +31,9 @@
>  #include 
>
>  #include "radeon.h"
> +#include "radeon_legacy_encoders.h"
>  #include "atom.h"
>
> -extern void
> -radeon_legacy_backlight_init(struct radeon_encoder *radeon_encoder,
> -struct drm_connector *drm_connector);
>  extern void
>  radeon_atom_backlight_init(struct radeon_encoder *radeon_encoder,
>struct drm_connector *drm_connector);
> diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c 
> b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
> index 44d060f75318e..e64fd0ce67070 100644
> --- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
> +++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
> @@ -35,6 +35,7 @@
>
>  #include "radeon.h"
>  #include "radeon_asic.h"
> +#include "radeon_legacy_encoders.h"
>  #include "atom.h"
>  #ifdef CONFIG_PMAC_BACKLIGHT
>  #include 
> diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.h 
> b/drivers/gpu/drm/radeon/radeon_legacy_encoders.h
> new file mode 100644
> index 0..a80b387559d4d
> --- /dev/null
> +++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.h
> @@ -0,0 +1,34 @@
> +/* radeon_legacy_encoders.h -- Private header for radeon driver -*- linux-c 
> -*-
> + *
> + * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
> + * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
> + * All rights reserved.
> + *
> + * 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
> OTHER
> + * DEALINGS IN THE SOFTWARE.
> + *
> + */
> +
> +#ifndef __RADEON_LEGACY_ENCODERS_H__
> +#define __RADEON_LEGACY_ENCODERS_H__
> +
> +void radeon_legacy_backlight_init(struct radeon_encoder *radeon_encoder,
> + struct drm_connector *drm_connector);
> +
> +#endif /* __RADEON_LEGACY_ENCODERS_H__ */
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 05/43] drm/radeon: Move radeon_ttm{init, fini} to shared location

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:30 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_ttm.c: At top level:
>  drivers/gpu/drm/radeon/radeon_ttm.c:817:5: warning: no previous prototype 
> for ‘radeon_ttm_init’ [-Wmissing-prototypes]
>  817 | int radeon_ttm_init(struct radeon_device *rdev)
>  | ^~~
>  drivers/gpu/drm/radeon/radeon_ttm.c:878:6: warning: no previous prototype 
> for ‘radeon_ttm_fini’ [-Wmissing-prototypes]
>  878 | void radeon_ttm_fini(struct radeon_device *rdev)
>  | ^~~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex


> ---
>  drivers/gpu/drm/radeon/radeon_object.c |  3 +--
>  drivers/gpu/drm/radeon/radeon_ttm.c|  1 +
>  drivers/gpu/drm/radeon/radeon_ttm.h| 36 ++
>  3 files changed, 38 insertions(+), 2 deletions(-)
>  create mode 100644 drivers/gpu/drm/radeon/radeon_ttm.h
>
> diff --git a/drivers/gpu/drm/radeon/radeon_object.c 
> b/drivers/gpu/drm/radeon/radeon_object.c
> index ab81e35cb0606..8bc5ad1d65857 100644
> --- a/drivers/gpu/drm/radeon/radeon_object.c
> +++ b/drivers/gpu/drm/radeon/radeon_object.c
> @@ -40,9 +40,8 @@
>
>  #include "radeon.h"
>  #include "radeon_trace.h"
> +#include "radeon_ttm.h"
>
> -int radeon_ttm_init(struct radeon_device *rdev);
> -void radeon_ttm_fini(struct radeon_device *rdev);
>  static void radeon_bo_clear_surface_reg(struct radeon_bo *bo);
>
>  /*
> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c 
> b/drivers/gpu/drm/radeon/radeon_ttm.c
> index 2939e71ceb700..28b300ed200ea 100644
> --- a/drivers/gpu/drm/radeon/radeon_ttm.c
> +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
> @@ -51,6 +51,7 @@
>
>  #include "radeon_reg.h"
>  #include "radeon.h"
> +#include "radeon_ttm.h"
>
>  static int radeon_ttm_debugfs_init(struct radeon_device *rdev);
>  static void radeon_ttm_debugfs_fini(struct radeon_device *rdev);
> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.h 
> b/drivers/gpu/drm/radeon/radeon_ttm.h
> new file mode 100644
> index 0..91ea7141bc812
> --- /dev/null
> +++ b/drivers/gpu/drm/radeon/radeon_ttm.h
> @@ -0,0 +1,36 @@
> +/* radeon_ttm.h -- Private header for radeon driver -*- linux-c -*-
> + *
> + * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
> + * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
> + * All rights reserved.
> + *
> + * 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
> OTHER
> + * DEALINGS IN THE SOFTWARE.
> + *
> + */
> +
> +#ifndef __RADEON_TTM_H__
> +#define __RADEON_TTM_H__
> +
> +struct radeon_device;
> +
> +int radeon_ttm_init(struct radeon_device *rdev);
> +void radeon_ttm_fini(struct radeon_device *rdev);
> +
> +#endif /* __RADEON_TTM_H__ */
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 04/43] drm/radeon/radeon_kms: Fix misnaming of 'radeon_info_ioctl's dev param

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:30 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_kms.c:226: warning: Function parameter or 
> member 'dev' not described in 'radeon_info_ioctl'
>  drivers/gpu/drm/radeon/radeon_kms.c:226: warning: Excess function parameter 
> 'rdev' description in 'radeon_info_ioctl'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/radeon_kms.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_kms.c 
> b/drivers/gpu/drm/radeon/radeon_kms.c
> index 001940bca90a6..50cee4880bb46 100644
> --- a/drivers/gpu/drm/radeon/radeon_kms.c
> +++ b/drivers/gpu/drm/radeon/radeon_kms.c
> @@ -214,7 +214,7 @@ static void radeon_set_filp_rights(struct drm_device *dev,
>  /**
>   * radeon_info_ioctl - answer a device specific request.
>   *
> - * @rdev: radeon device pointer
> + * @dev: drm device pointer
>   * @data: request object
>   * @filp: drm filp
>   *
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 03/43] drm/radeon/radeon_kms: Move 'radeon_*_kms' prototypes to shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:30 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_kms.c:756:5: warning: no previous prototype 
> for ‘radeon_get_vblank_counter_kms’ [-Wmissing-prototypes]
>  756 | u32 radeon_get_vblank_counter_kms(struct drm_crtc *crtc)
>  | ^
>  drivers/gpu/drm/radeon/radeon_kms.c:826:5: warning: no previous prototype 
> for ‘radeon_enable_vblank_kms’ [-Wmissing-prototypes]
>  826 | int radeon_enable_vblank_kms(struct drm_crtc *crtc)
>  | ^~~~
>  drivers/gpu/drm/radeon/radeon_kms.c:853:6: warning: no previous prototype 
> for ‘radeon_disable_vblank_kms’ [-Wmissing-prototypes]
>  853 | void radeon_disable_vblank_kms(struct drm_crtc *crtc)
>  | ^
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/radeon_display.c |  1 +
>  drivers/gpu/drm/radeon/radeon_kms.c |  1 +
>  drivers/gpu/drm/radeon/radeon_kms.h | 35 +
>  3 files changed, 37 insertions(+)
>  create mode 100644 drivers/gpu/drm/radeon/radeon_kms.h
>
> diff --git a/drivers/gpu/drm/radeon/radeon_display.c 
> b/drivers/gpu/drm/radeon/radeon_display.c
> index eb0d4cb95f0a6..3a6fedad002d7 100644
> --- a/drivers/gpu/drm/radeon/radeon_display.c
> +++ b/drivers/gpu/drm/radeon/radeon_display.c
> @@ -44,6 +44,7 @@
>
>  #include "atom.h"
>  #include "radeon.h"
> +#include "radeon_kms.h"
>
>  static void avivo_crtc_load_lut(struct drm_crtc *crtc)
>  {
> diff --git a/drivers/gpu/drm/radeon/radeon_kms.c 
> b/drivers/gpu/drm/radeon/radeon_kms.c
> index 3d31c04e4b3db..001940bca90a6 100644
> --- a/drivers/gpu/drm/radeon/radeon_kms.c
> +++ b/drivers/gpu/drm/radeon/radeon_kms.c
> @@ -41,6 +41,7 @@
>  #include "radeon.h"
>  #include "radeon_asic.h"
>  #include "radeon_drv.h"
> +#include "radeon_kms.h"
>
>  #if defined(CONFIG_VGA_SWITCHEROO)
>  bool radeon_has_atpx(void);
> diff --git a/drivers/gpu/drm/radeon/radeon_kms.h 
> b/drivers/gpu/drm/radeon/radeon_kms.h
> new file mode 100644
> index 0..36e73cea92154
> --- /dev/null
> +++ b/drivers/gpu/drm/radeon/radeon_kms.h
> @@ -0,0 +1,35 @@
> +/* radeon_kms.h -- Private header for radeon driver -*- linux-c -*-
> + *
> + * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
> + * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
> + * All rights reserved.
> + *
> + * 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
> OTHER
> + * DEALINGS IN THE SOFTWARE.
> + *
> + */
> +
> +#ifndef __RADEON_KMS_H__
> +#define __RADEON_KMS_H__
> +
> +u32 radeon_get_vblank_counter_kms(struct drm_crtc *crtc);
> +int radeon_enable_vblank_kms(struct drm_crtc *crtc);
> +void radeon_disable_vblank_kms(struct drm_crtc *crtc);
> +
> +#endif /* __RADEON_KMS_H__ */
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 02/43] drm/radeon/radeon: Move prototype into shared header

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:30 PM Lee Jones  wrote:
>
> Unfortunately, a suitable one didn't already exist.
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_device.c:637:6: warning: no previous prototype 
> for ‘radeon_device_is_virtual’ [-Wmissing-prototypes]
>  637 | bool radeon_device_is_virtual(void)
>  | ^~~~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/radeon_device.c |  1 +
>  drivers/gpu/drm/radeon/radeon_device.h | 32 ++
>  drivers/gpu/drm/radeon/radeon_drv.c|  3 +--
>  3 files changed, 34 insertions(+), 2 deletions(-)
>  create mode 100644 drivers/gpu/drm/radeon/radeon_device.h
>
> diff --git a/drivers/gpu/drm/radeon/radeon_device.c 
> b/drivers/gpu/drm/radeon/radeon_device.c
> index 7f384ffe848a7..ad572f965190b 100644
> --- a/drivers/gpu/drm/radeon/radeon_device.c
> +++ b/drivers/gpu/drm/radeon/radeon_device.c
> @@ -42,6 +42,7 @@
>  #include 
>  #include 
>
> +#include "radeon_device.h"
>  #include "radeon_reg.h"
>  #include "radeon.h"
>  #include "atom.h"
> diff --git a/drivers/gpu/drm/radeon/radeon_device.h 
> b/drivers/gpu/drm/radeon/radeon_device.h
> new file mode 100644
> index 0..3112b99ae36f1
> --- /dev/null
> +++ b/drivers/gpu/drm/radeon/radeon_device.h
> @@ -0,0 +1,32 @@
> +/* radeon_device.h -- Private header for radeon device -*- linux-c -*-
> + *
> + * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
> + * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
> + * All rights reserved.
> + *
> + * 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
> OTHER
> + * DEALINGS IN THE SOFTWARE.
> + */
> +
> +#ifndef __RADEON_DEVICE_H__
> +#define __RADEON_DEVICE_H__
> +
> +bool radeon_device_is_virtual(void);
> +
> +#endif /* __RADEON_DEVICE_H__ */
> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c 
> b/drivers/gpu/drm/radeon/radeon_drv.c
> index f813eb5e140dd..536b246b9a6aa 100644
> --- a/drivers/gpu/drm/radeon/radeon_drv.c
> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
> @@ -52,6 +52,7 @@
>
>  #include "radeon_drv.h"
>  #include "radeon.h"
> +#include "radeon_device.h"
>
>  /*
>   * KMS wrapper.
> @@ -293,8 +294,6 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
>
>  static const struct drm_driver kms_driver;
>
> -bool radeon_device_is_virtual(void);
> -
>  static int radeon_pci_probe(struct pci_dev *pdev,
> const struct pci_device_id *ent)
>  {
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 01/43] drm/radeon/atombios_encoders: Move 'radeon_atom_get_tv_timings()'s prototype into shared location

2020-11-16 Thread Alex Deucher
On Mon, Nov 16, 2020 at 12:30 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_atombios.c:1791:6: warning: no previous 
> prototype for ‘radeon_atom_get_tv_timings’ [-Wmissing-prototypes]
>  1791 | bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index,
>  | ^~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/atombios_encoders.c |  5 +--
>  drivers/gpu/drm/radeon/radeon_atombios.c   |  1 +
>  drivers/gpu/drm/radeon/radeon_atombios.h   | 37 ++
>  3 files changed, 39 insertions(+), 4 deletions(-)
>  create mode 100644 drivers/gpu/drm/radeon/radeon_atombios.h
>
> diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c 
> b/drivers/gpu/drm/radeon/atombios_encoders.c
> index cc5ee1b3af84f..683de198e18d9 100644
> --- a/drivers/gpu/drm/radeon/atombios_encoders.c
> +++ b/drivers/gpu/drm/radeon/atombios_encoders.c
> @@ -33,6 +33,7 @@
>  #include 
>
>  #include "atom.h"
> +#include "radeon_atombios.h"
>  #include "radeon.h"
>  #include "radeon_asic.h"
>  #include "radeon_audio.h"
> @@ -296,10 +297,6 @@ static void radeon_atom_backlight_exit(struct 
> radeon_encoder *encoder)
>
>  #endif
>
> -/* evil but including atombios.h is much worse */
> -bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index,
> -   struct drm_display_mode *mode);
> -
>  static bool radeon_atom_mode_fixup(struct drm_encoder *encoder,
>const struct drm_display_mode *mode,
>struct drm_display_mode *adjusted_mode)
> diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c 
> b/drivers/gpu/drm/radeon/radeon_atombios.c
> index 5d25917251892..71bf2ed172697 100644
> --- a/drivers/gpu/drm/radeon/radeon_atombios.c
> +++ b/drivers/gpu/drm/radeon/radeon_atombios.c
> @@ -34,6 +34,7 @@
>  #include "atom.h"
>  #include "atom-bits.h"
>  #include "radeon_asic.h"
> +#include "radeon_atombios.h"
>
>  extern void
>  radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_enum,
> diff --git a/drivers/gpu/drm/radeon/radeon_atombios.h 
> b/drivers/gpu/drm/radeon/radeon_atombios.h
> new file mode 100644
> index 0..b7c76920feb7d
> --- /dev/null
> +++ b/drivers/gpu/drm/radeon/radeon_atombios.h
> @@ -0,0 +1,37 @@
> +/* radeon_atombios.h -- Private header for radeon driver -*- linux-c -*-
> + *
> + * Copyright 2007-8 Advanced Micro Devices, Inc.
> + * Copyright 2008 Red Hat 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice shall be included in
> + * all copies or substantial portions of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> + * OTHER DEALINGS IN THE SOFTWARE.
> + *
> + * Authors: Dave Airlie
> + *  Alex Deucher
> + */
> +
> +#ifndef __RADEON_ATOMBIOS_H__
> +#define __RADEON_ATOMBIOS_H__
> +
> +struct drm_display_mode;
> +struct radeon_device;
> +
> +bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index,
> +   struct drm_display_mode *mode);
> +
> +#endif /* __RADEON_ATOMBIOS_H__ */
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH 03/43] drm/radeon/radeon_kms: Move 'radeon_*_kms' prototypes to shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_kms.c:756:5: warning: no previous prototype for 
‘radeon_get_vblank_counter_kms’ [-Wmissing-prototypes]
 756 | u32 radeon_get_vblank_counter_kms(struct drm_crtc *crtc)
 | ^
 drivers/gpu/drm/radeon/radeon_kms.c:826:5: warning: no previous prototype for 
‘radeon_enable_vblank_kms’ [-Wmissing-prototypes]
 826 | int radeon_enable_vblank_kms(struct drm_crtc *crtc)
 | ^~~~
 drivers/gpu/drm/radeon/radeon_kms.c:853:6: warning: no previous prototype for 
‘radeon_disable_vblank_kms’ [-Wmissing-prototypes]
 853 | void radeon_disable_vblank_kms(struct drm_crtc *crtc)
 | ^

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Sumit Semwal 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Cc: linux-me...@vger.kernel.org
Cc: linaro-mm-...@lists.linaro.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/radeon_display.c |  1 +
 drivers/gpu/drm/radeon/radeon_kms.c |  1 +
 drivers/gpu/drm/radeon/radeon_kms.h | 35 +
 3 files changed, 37 insertions(+)
 create mode 100644 drivers/gpu/drm/radeon/radeon_kms.h

diff --git a/drivers/gpu/drm/radeon/radeon_display.c 
b/drivers/gpu/drm/radeon/radeon_display.c
index eb0d4cb95f0a6..3a6fedad002d7 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -44,6 +44,7 @@
 
 #include "atom.h"
 #include "radeon.h"
+#include "radeon_kms.h"
 
 static void avivo_crtc_load_lut(struct drm_crtc *crtc)
 {
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c 
b/drivers/gpu/drm/radeon/radeon_kms.c
index 3d31c04e4b3db..001940bca90a6 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -41,6 +41,7 @@
 #include "radeon.h"
 #include "radeon_asic.h"
 #include "radeon_drv.h"
+#include "radeon_kms.h"
 
 #if defined(CONFIG_VGA_SWITCHEROO)
 bool radeon_has_atpx(void);
diff --git a/drivers/gpu/drm/radeon/radeon_kms.h 
b/drivers/gpu/drm/radeon/radeon_kms.h
new file mode 100644
index 0..36e73cea92154
--- /dev/null
+++ b/drivers/gpu/drm/radeon/radeon_kms.h
@@ -0,0 +1,35 @@
+/* radeon_kms.h -- Private header for radeon driver -*- linux-c -*-
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
+ * All rights reserved.
+ *
+ * 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef __RADEON_KMS_H__
+#define __RADEON_KMS_H__
+
+u32 radeon_get_vblank_counter_kms(struct drm_crtc *crtc);
+int radeon_enable_vblank_kms(struct drm_crtc *crtc);
+void radeon_disable_vblank_kms(struct drm_crtc *crtc);
+
+#endif /* __RADEON_KMS_H__ */
-- 
2.25.1

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


[PATCH 41/43] drm/radeon/evergreen_cs: Move 'r600_dma_cs_next_reloc()'s prototype to shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/r600_cs.c:2343:5: warning: no previous prototype for 
‘r600_dma_cs_next_reloc’ [-Wmissing-prototypes]
 2343 | int r600_dma_cs_next_reloc(struct radeon_cs_parser *p,
 | ^~

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/evergreen_cs.c | 3 +--
 drivers/gpu/drm/radeon/r600.h | 4 
 drivers/gpu/drm/radeon/r600_cs.c  | 1 +
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c 
b/drivers/gpu/drm/radeon/evergreen_cs.c
index 53b75cf201958..0de79f3a7e3ff 100644
--- a/drivers/gpu/drm/radeon/evergreen_cs.c
+++ b/drivers/gpu/drm/radeon/evergreen_cs.c
@@ -28,6 +28,7 @@
 
 #include "radeon.h"
 #include "radeon_asic.h"
+#include "r600.h"
 #include "evergreend.h"
 #include "evergreen_reg_safe.h"
 #include "cayman_reg_safe.h"
@@ -37,8 +38,6 @@
 
 #define REG_SAFE_BM_SIZE ARRAY_SIZE(evergreen_reg_safe_bm)
 
-int r600_dma_cs_next_reloc(struct radeon_cs_parser *p,
-  struct radeon_bo_list **cs_reloc);
 struct evergreen_cs_track {
u32 group_size;
u32 nbanks;
diff --git a/drivers/gpu/drm/radeon/r600.h b/drivers/gpu/drm/radeon/r600.h
index e66ef58706cd8..dbdff4568516b 100644
--- a/drivers/gpu/drm/radeon/r600.h
+++ b/drivers/gpu/drm/radeon/r600.h
@@ -28,10 +28,14 @@
 #ifndef __R600_H__
 #define __R600_H__
 
+struct radeon_bo_list;
+struct radeon_cs_parser;
 struct radeon_device;
 
 u32 r600_gpu_check_soft_reset(struct radeon_device *rdev);
 int r600_ih_ring_alloc(struct radeon_device *rdev);
 void r600_ih_ring_fini(struct radeon_device *rdev);
 
+int r600_dma_cs_next_reloc(struct radeon_cs_parser *p,
+  struct radeon_bo_list **cs_reloc);
 #endif /* __R600_H__ */
diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c
index f20b619466816..dc68e538d5a97 100644
--- a/drivers/gpu/drm/radeon/r600_cs.c
+++ b/drivers/gpu/drm/radeon/r600_cs.c
@@ -29,6 +29,7 @@
 
 #include "radeon.h"
 #include "radeon_asic.h"
+#include "r600.h"
 #include "r600d.h"
 #include "r600_reg_safe.h"
 
-- 
2.25.1

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


[RESEND v2 00/43] Rid W=1 warnings from GPU

2020-11-16 Thread Lee Jones
[sending again, as `git send-email` crashed!]

This set contains fixes for some "wouldn't it be nice if" issues,
however most of the patches seen here have been on the MLs, but
were left unreviewed.

Lee Jones (43):
  drm/radeon/atombios_encoders: Move 'radeon_atom_get_tv_timings()'s
prototype into shared location
  drm/radeon/radeon: Move prototype into shared header
  drm/radeon/radeon_kms: Move 'radeon_*_kms' prototypes to shared header
  drm/radeon/radeon_kms: Fix misnaming of 'radeon_info_ioctl's dev param
  drm/radeon: Move radeon_ttm{init,fini} to shared location
  drm/radeon/radeon_legacy_encoders: Move 'radeon_add_legacy_encoder'
prototype to shared header
  drm/radeon/radeon_legacy_encoders: Move 'radeon_add_legacy_encoder's
prototype to shared location
  drm/radeon/radeon_irq_kms: Demote non-conformant kernel-doc fix
another
  drm/radeon/rv770: Move 'rv770_set_clk_bypass_mode' prototype to shared
location
  drm/radeon/radeon_pm: Move 'radeon_pm_acpi_event_handler' prototype
into shared header
  drm/radeon/radeon_audio: Move 'dce3_2_*' prototypes to shared location
  drm/radeon/evergreen: Move 'evergreen_*' and 'sumo_*' prototypes out
to shared location
  drm/radeon/radeon_drv: Move 'radeon_mmap()'s prototype to shared
header
  drm/radeon/radeon_drv: Move 'radeon_driver_irq_handler_kms's prototype
into shared header
  drm/radeon/atom: Move 'radeon_atom_hw_i2c_*()'s prototypes into shared
header
  drm/radeon/radeon_gem: Move 'radeon_gem_prime_*()'s prototypes to
shared header
  drm/radeon/evergreen_hdmi: Move 'evergreen_*()' and 'dce4_*()' HDMI
prototypes to shared header
  drm/radeon/rv770: Move 'rv770_get_*()'s prototypes to shared header
  drm/radeon/ni_dpm: Move 'ni_get_{pi,ps}()'s into shared header
  drm/radeon/evergreen: Move 'cayman_*()'s prototypes to shared header
  drm/radeon/r600_dma: Move 'r600_gpu_check_soft_reset()'s prototype to
shared location
  drm/radeon/cik: Move 'r600_ih_ring_{alloc,fini}()'s prototypes to
shared header
  drm/radeon/evergreen_dma: Move 'evergreen_gpu_check_soft_reset()'s
prototype to shared header
  drm/radeon/r600: Move 'evergreen_rlc_resume()'s prototype to shared
header
  drm/radeon/ni_dma: Move 'cayman_gpu_check_soft_reset()'s prototype to
shared header
  drm/radeon/radeon_atombios: Move 'radeon_add_atom_encoder()'s
prototype to shared header
  drm/radeon/radeon_encoders: Move 'radeon_atom_backlight_init's
prototype to shared header
  drm/radeon/ci_dpm: Move 'ci_*()'s prototypes to shared header
  drm/radeon/si_dpm: Move 'si_mc_load_microcode()'s prototype to shared
header
  drm/radeon/si_dma: Move 'si_gpu_check_soft_reset()'s prototype to
shared header
  drm/radeon/cik: Move 'si_*()'s prototypes to shared header
  drm/radeon/btc_dpm: Move 'evergreen_get_pi's prototype to shared
header
  drm/radeon/radeon_audio: Move 'dce6_*()'s prototypes to shared header
  drm/radeon/evergreen: Move 'si_get_csb_*()'s prototypes to shared
header
  drm/radeon/cik_sdma: Move 'amdgpu_cik_gpu_check_soft_reset()'s
prototype to shared header
  drm/radeon/evergreen: Move 'cik_*()'s prototypes to shared header
  drm/radeon/ci_dpm: Move 'si_*()'s prototypes to shared header
  drm/radeon/cik: Move 'Move 'cik_sdma_*()'s prototypes to shared header
  drm/radeon/si_dpm: Move 'vce_v1_0_enable_mgcg()'s prototype to shared
header
  drm/radeon/cik: Move 'vce_v2_0_enable_mgcg()'s prototype to shared
header
  drm/radeon/evergreen_cs: Move 'r600_dma_cs_next_reloc()'s prototype to
shared header
  drm/radeon/radeon_audio: Move 'r600_*' prototypes into shared header
  drm/radeon/radeon_drv: Move 'radeon_gem_prime_import_sg_table()'s
prototype to shared header

 drivers/gpu/drm/radeon/atom.h |  7 ++
 drivers/gpu/drm/radeon/atombios_encoders.c|  5 +-
 drivers/gpu/drm/radeon/btc_dpm.c  |  6 +-
 drivers/gpu/drm/radeon/ci_dpm.c   | 13 +---
 drivers/gpu/drm/radeon/cik.c  | 19 ++---
 drivers/gpu/drm/radeon/cik.h  | 40 +++
 drivers/gpu/drm/radeon/cik_sdma.c |  3 +-
 drivers/gpu/drm/radeon/cypress_dpm.c  |  6 +-
 drivers/gpu/drm/radeon/dce6_afmt.c|  1 +
 drivers/gpu/drm/radeon/dce6_afmt.h| 52 ++
 drivers/gpu/drm/radeon/evergreen.c| 16 ++---
 drivers/gpu/drm/radeon/evergreen.h| 55 +++
 drivers/gpu/drm/radeon/evergreen_cs.c |  3 +-
 drivers/gpu/drm/radeon/evergreen_dma.c|  3 +-
 drivers/gpu/drm/radeon/evergreen_hdmi.c   |  1 +
 drivers/gpu/drm/radeon/evergreen_hdmi.h   | 69 +++
 drivers/gpu/drm/radeon/ni.c   | 17 +
 drivers/gpu/drm/radeon/ni.h   | 39 +++
 drivers/gpu/drm/radeon/ni_dma.c   |  3 +-
 drivers/gpu/drm/radeon/ni_dpm.c   |  5 +-
 drivers/gpu/drm/radeon/ni_dpm.h   |  3 +
 

[PATCH 26/43] drm/radeon/radeon_atombios: Move 'radeon_add_atom_encoder()'s prototype to shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/atombios_encoders.c:2721:1: warning: no previous 
prototype for ‘radeon_add_atom_encoder’ [-Wmissing-prototypes]
 2721 | radeon_add_atom_encoder(struct drm_device *dev,
 | ^~~

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/radeon_atombios.c | 4 
 drivers/gpu/drm/radeon/radeon_atombios.h | 4 
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c 
b/drivers/gpu/drm/radeon/radeon_atombios.c
index cc80651b25773..be96d9b64e43b 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -37,10 +37,6 @@
 #include "radeon_atombios.h"
 #include "radeon_legacy_encoders.h"
 
-extern void
-radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_enum,
-   uint32_t supported_device, u16 caps);
-
 union atom_supported_devices {
struct _ATOM_SUPPORTED_DEVICES_INFO info;
struct _ATOM_SUPPORTED_DEVICES_INFO_2 info_2;
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.h 
b/drivers/gpu/drm/radeon/radeon_atombios.h
index b7c76920feb7d..a895a7002c3d3 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.h
+++ b/drivers/gpu/drm/radeon/radeon_atombios.h
@@ -28,10 +28,14 @@
 #ifndef __RADEON_ATOMBIOS_H__
 #define __RADEON_ATOMBIOS_H__
 
+struct drm_device;
 struct drm_display_mode;
 struct radeon_device;
 
 bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index,
struct drm_display_mode *mode);
+void radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_enum,
+uint32_t supported_device, u16 caps);
+
 
 #endif /* __RADEON_ATOMBIOS_H__ */
-- 
2.25.1

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


[PATCH 08/43] drm/radeon/radeon_irq_kms: Demote non-conformant kernel-doc fix another

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_irq_kms.c:56: warning: Function parameter or 
member 'irq' not described in 'radeon_driver_irq_handler_kms'
 drivers/gpu/drm/radeon/radeon_irq_kms.c:56: warning: Function parameter or 
member 'arg' not described in 'radeon_driver_irq_handler_kms'
 drivers/gpu/drm/radeon/radeon_irq_kms.c:571: warning: Function parameter or 
member 'n' not described in 'radeon_irq_kms_set_irq_n_enabled'
 drivers/gpu/drm/radeon/radeon_irq_kms.c:571: warning: Excess function 
parameter 'num' description in 'radeon_irq_kms_set_irq_n_enabled'

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/radeon_irq_kms.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c 
b/drivers/gpu/drm/radeon/radeon_irq_kms.c
index b86bc88ad4308..a242b6053d47e 100644
--- a/drivers/gpu/drm/radeon/radeon_irq_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c
@@ -43,11 +43,9 @@
 
 #define RADEON_WAIT_IDLE_TIMEOUT 200
 
-/**
+/*
  * radeon_driver_irq_handler_kms - irq handler for KMS
  *
- * @int irq, void *arg: args
- *
  * This is the irq handler for the radeon KMS driver (all asics).
  * radeon_irq_process is a macro that points to the per-asic
  * irq handler callback.
@@ -549,14 +547,14 @@ void radeon_irq_kms_disable_hpd(struct radeon_device 
*rdev, unsigned hpd_mask)
 }
 
 /**
- * radeon_irq_kms_update_int_n - helper for updating interrupt enable registers
+ * radeon_irq_kms_set_irq_n_enabled - helper for updating interrupt enable 
registers
  *
  * @rdev: radeon device pointer
  * @reg: the register to write to enable/disable interrupts
  * @mask: the mask that enables the interrupts
  * @enable: whether to enable or disable the interrupt register
  * @name: the name of the interrupt register to print to the kernel log
- * @num: the number of the interrupt register to print to the kernel log
+ * @n: the number of the interrupt register to print to the kernel log
  *
  * Helper for updating the enable state of interrupt registers. Checks whether
  * or not the interrupt matches the enable state we want. If it doesn't, then
-- 
2.25.1

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


[PATCH 05/43] drm/radeon: Move radeon_ttm{init, fini} to shared location

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_ttm.c: At top level:
 drivers/gpu/drm/radeon/radeon_ttm.c:817:5: warning: no previous prototype for 
‘radeon_ttm_init’ [-Wmissing-prototypes]
 817 | int radeon_ttm_init(struct radeon_device *rdev)
 | ^~~
 drivers/gpu/drm/radeon/radeon_ttm.c:878:6: warning: no previous prototype for 
‘radeon_ttm_fini’ [-Wmissing-prototypes]
 878 | void radeon_ttm_fini(struct radeon_device *rdev)
 | ^~~

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Sumit Semwal 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Cc: linux-me...@vger.kernel.org
Cc: linaro-mm-...@lists.linaro.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/radeon_object.c |  3 +--
 drivers/gpu/drm/radeon/radeon_ttm.c|  1 +
 drivers/gpu/drm/radeon/radeon_ttm.h| 36 ++
 3 files changed, 38 insertions(+), 2 deletions(-)
 create mode 100644 drivers/gpu/drm/radeon/radeon_ttm.h

diff --git a/drivers/gpu/drm/radeon/radeon_object.c 
b/drivers/gpu/drm/radeon/radeon_object.c
index ab81e35cb0606..8bc5ad1d65857 100644
--- a/drivers/gpu/drm/radeon/radeon_object.c
+++ b/drivers/gpu/drm/radeon/radeon_object.c
@@ -40,9 +40,8 @@
 
 #include "radeon.h"
 #include "radeon_trace.h"
+#include "radeon_ttm.h"
 
-int radeon_ttm_init(struct radeon_device *rdev);
-void radeon_ttm_fini(struct radeon_device *rdev);
 static void radeon_bo_clear_surface_reg(struct radeon_bo *bo);
 
 /*
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c 
b/drivers/gpu/drm/radeon/radeon_ttm.c
index 2939e71ceb700..28b300ed200ea 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -51,6 +51,7 @@
 
 #include "radeon_reg.h"
 #include "radeon.h"
+#include "radeon_ttm.h"
 
 static int radeon_ttm_debugfs_init(struct radeon_device *rdev);
 static void radeon_ttm_debugfs_fini(struct radeon_device *rdev);
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.h 
b/drivers/gpu/drm/radeon/radeon_ttm.h
new file mode 100644
index 0..91ea7141bc812
--- /dev/null
+++ b/drivers/gpu/drm/radeon/radeon_ttm.h
@@ -0,0 +1,36 @@
+/* radeon_ttm.h -- Private header for radeon driver -*- linux-c -*-
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
+ * All rights reserved.
+ *
+ * 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef __RADEON_TTM_H__
+#define __RADEON_TTM_H__
+
+struct radeon_device;
+
+int radeon_ttm_init(struct radeon_device *rdev);
+void radeon_ttm_fini(struct radeon_device *rdev);
+
+#endif /* __RADEON_TTM_H__ */
-- 
2.25.1

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


[PATCH 21/43] drm/radeon/r600_dma: Move 'r600_gpu_check_soft_reset()'s prototype to shared location

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/r600.c:1615:5: warning: no previous prototype for 
‘r600_gpu_check_soft_reset’ [-Wmissing-prototypes]
 1615 | u32 r600_gpu_check_soft_reset(struct radeon_device *rdev)
 | ^

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Sumit Semwal 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Cc: linux-me...@vger.kernel.org
Cc: linaro-mm-...@lists.linaro.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/r600.c |  1 +
 drivers/gpu/drm/radeon/r600.h | 35 +++
 drivers/gpu/drm/radeon/r600_dma.c |  3 +--
 3 files changed, 37 insertions(+), 2 deletions(-)
 create mode 100644 drivers/gpu/drm/radeon/r600.h

diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index f09b6dc5cbeb3..94e8815e5067d 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -39,6 +39,7 @@
 
 #include "atom.h"
 #include "avivod.h"
+#include "r600.h"
 #include "r600d.h"
 #include "rv770.h"
 #include "radeon.h"
diff --git a/drivers/gpu/drm/radeon/r600.h b/drivers/gpu/drm/radeon/r600.h
new file mode 100644
index 0..2a3915f0039e4
--- /dev/null
+++ b/drivers/gpu/drm/radeon/r600.h
@@ -0,0 +1,35 @@
+/* r600.h -- Private header for radeon driver -*- linux-c -*-
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
+ * All rights reserved.
+ *
+ * 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef __R600_H__
+#define __R600_H__
+
+struct radeon_device;
+
+u32 r600_gpu_check_soft_reset(struct radeon_device *rdev);
+
+#endif /* __R600_H__ */
diff --git a/drivers/gpu/drm/radeon/r600_dma.c 
b/drivers/gpu/drm/radeon/r600_dma.c
index af6c0da45f28a..89ca2738c5d4c 100644
--- a/drivers/gpu/drm/radeon/r600_dma.c
+++ b/drivers/gpu/drm/radeon/r600_dma.c
@@ -24,10 +24,9 @@
 
 #include "radeon.h"
 #include "radeon_asic.h"
+#include "r600.h"
 #include "r600d.h"
 
-u32 r600_gpu_check_soft_reset(struct radeon_device *rdev);
-
 /*
  * DMA
  * Starting with R600, the GPU has an asynchronous
-- 
2.25.1

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


[PATCH 15/43] drm/radeon/atom: Move 'radeon_atom_hw_i2c_*()'s prototypes into shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/atombios_i2c.c:100:5: warning: no previous prototype 
for ‘radeon_atom_hw_i2c_xfer’ [-Wmissing-prototypes]
 100 | int radeon_atom_hw_i2c_xfer(struct i2c_adapter *i2c_adap,
 | ^~~
 drivers/gpu/drm/radeon/atombios_i2c.c:150:5: warning: no previous prototype 
for ‘radeon_atom_hw_i2c_func’ [-Wmissing-prototypes]
 150 | u32 radeon_atom_hw_i2c_func(struct i2c_adapter *adap)
 | ^~~

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/atom.h   | 7 +++
 drivers/gpu/drm/radeon/radeon_i2c.c | 4 
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atom.h b/drivers/gpu/drm/radeon/atom.h
index 1bf06c91cd959..5de0563b63d2e 100644
--- a/drivers/gpu/drm/radeon/atom.h
+++ b/drivers/gpu/drm/radeon/atom.h
@@ -154,6 +154,13 @@ bool atom_parse_data_header(struct atom_context *ctx, int 
index, uint16_t *size,
 bool atom_parse_cmd_header(struct atom_context *ctx, int index,
   uint8_t *frev, uint8_t *crev);
 int atom_allocate_fb_scratch(struct atom_context *ctx);
+
+struct i2c_msg;
+struct i2c_adapter;
+int radeon_atom_hw_i2c_xfer(struct i2c_adapter *i2c_adap,
+   struct i2c_msg *msgs, int num);
+u32 radeon_atom_hw_i2c_func(struct i2c_adapter *adap);
+
 #include "atom-types.h"
 #include "atombios.h"
 #include "ObjectID.h"
diff --git a/drivers/gpu/drm/radeon/radeon_i2c.c 
b/drivers/gpu/drm/radeon/radeon_i2c.c
index aa61b3cb4049c..e543d993f73ee 100644
--- a/drivers/gpu/drm/radeon/radeon_i2c.c
+++ b/drivers/gpu/drm/radeon/radeon_i2c.c
@@ -34,10 +34,6 @@
 #include "radeon.h"
 #include "atom.h"
 
-extern int radeon_atom_hw_i2c_xfer(struct i2c_adapter *i2c_adap,
-  struct i2c_msg *msgs, int num);
-extern u32 radeon_atom_hw_i2c_func(struct i2c_adapter *adap);
-
 bool radeon_ddc_probe(struct radeon_connector *radeon_connector, bool use_aux)
 {
u8 out = 0x0;
-- 
2.25.1

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


[RESEND 00/42] Rid W=1 warnings from GPU (non-Radeon)

2020-11-16 Thread Lee Jones
This set contains fixes for some "wouldn't it be nice if" issues,
however most of the patches seen here have been on the MLs, but
were left unreviewed.

Lee Jones (42):
  drm/amd/amdgpu/atombios_encoders: Remove set but unused variable
'backlight_level'
  drm/armada/armada_overlay: Staticify local function
'armada_overlay_duplicate_state'
  drm/drm_dp_mst_topology: Remove set but never used variable 'len'
  drm/exynos/exynos7_drm_decon: Supply missing description for  param
'ctx'
  drm/exynos/exynos_drm_fimd: Add missing description for param 'ctx'
  drm/exynos/exynos_drm_gsc: Supply missing description for 'num_limits'
  drm/mediatek/mtk_dpi: Remove unused struct definition
'mtk_dpi_encoder_funcs'
  drm/mediatek/mtk_disp_color: Fix formatting and provide missing member
description
  drm/mediatek/mtk_disp_ovl: Fix formatting and provide missing member
description
  drm/mediatek/mtk_disp_rdma: Fix formatting and supply missing struct
member description
  drm/mediatek/mtk_drm_crtc: Demote seriously out-of-date struct header
  drm/mediatek/mtk_drm_drv: Staticise local function invoked by
reference
  drm/meson/meson_venc: Make local function
'meson_venc_hdmi_get_dmt_vmode' static
  drm/meson/meson_vclk: Make two local functions static
  drm/msm/adreno/a6xx_gpu: Staticise local function 'a6xx_idle'
  drm/msm/disp/mdp5/mdp5_crtc: Make local function
'mdp5_crtc_setup_pipeline()' static
  drm/msm/disp/mdp5/mdp5_ctl: Demote non-conformant kernel-doc headers
  drm/msm/disp/mdp5/mdp5_kms: Make local functions 'mdp5_{en,dis}able()'
static
  drm/msm/disp/dpu1/dpu_core_perf: Remove set but unused variable
'dpu_cstate'
  drm/msm/disp/dpu1/dpu_encoder: Remove a bunch of unused variables
  drm/nouveau/nvkm/core/firmware: Fix formatting, provide missing param
description
  drm/pl111/pl111_display: Make local function static
  drm/pl111/pl111_debugfs: Make local function 'pl111_debugfs_regs()'
static
  drm/rockchip/dw-mipi-dsi-rockchip: Demote non-conformant kernel-doc
headers
  drm/rockchip/rockchip_rgb: Consume our own header
  drm/rockchip/rockchip_lvds: Fix struct document formatting
  drm/selftests/test-drm_mm: Mark 'hole_end' as always_unused
  drm/selftests/test-drm_framebuffer: Remove set but unused variable
'fb'
  drm/selftests/test-drm_dp_mst_helper: Place 'struct
drm_dp_sideband_msg_req_body' onto the heap
  drm/selftests/test-drm_dp_mst_helper: Move
'sideband_msg_req_encode_decode' onto the heap
  drm/ttm/ttm_bo: Fix one function header - demote lots of kernel-doc
abuses
  drm/ttm/ttm_tt: Demote kernel-doc header format abuses
  drm/ttm/ttm_range_manager: Demote non-conformant kernel-doc header
  drm/v3d/v3d_drv: Remove unused static variable 'v3d_v3d_pm_ops'
  drm/v3d/v3d_gem: Provide descriptions for 'v3d_lookup_bos's params
  drm/v3d/v3d_sched: Demote non-conformant kernel-doc header
  drm/vc4/vc4_hdmi_regs: Mark some data sets as __maybe_unused
  drm/vc4/vc4_hdmi: Remove set but unused variable 'ret'
  drm/vc4/vc4_v3d: Demote non-conformant kernel-doc headers
  drm/vc4/vc4_debugfs: Demote non-conformant kernel-doc headers
  gpu/ipu-v3/ipu-di: Strip out 2 unused 'di_sync_config' entries
  include/drm/drm_atomic: Make use of 'new_crtc_state'

 .../gpu/drm/amd/amdgpu/atombios_encoders.c|  3 --
 drivers/gpu/drm/armada/armada_overlay.c   |  2 +-
 drivers/gpu/drm/drm_dp_mst_topology.c |  4 +-
 drivers/gpu/drm/exynos/exynos7_drm_decon.c|  1 +
 drivers/gpu/drm/exynos/exynos_drm_fimd.c  |  1 +
 drivers/gpu/drm/exynos/exynos_drm_gsc.c   |  1 +
 drivers/gpu/drm/mediatek/mtk_disp_color.c |  5 ++-
 drivers/gpu/drm/mediatek/mtk_disp_ovl.c   |  5 ++-
 drivers/gpu/drm/mediatek/mtk_disp_rdma.c  |  5 ++-
 drivers/gpu/drm/mediatek/mtk_dpi.c|  9 -
 drivers/gpu/drm/mediatek/mtk_drm_crtc.c   |  4 +-
 drivers/gpu/drm/mediatek/mtk_drm_drv.c|  4 +-
 drivers/gpu/drm/meson/meson_vclk.c|  8 ++--
 drivers/gpu/drm/meson/meson_venc.c|  4 +-
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c |  2 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c |  3 --
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c   | 12 +-
 drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c |  6 +--
 drivers/gpu/drm/msm/disp/mdp5/mdp5_ctl.c  |  6 +--
 drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c  |  4 +-
 drivers/gpu/drm/nouveau/nvkm/core/firmware.c  |  9 +++--
 drivers/gpu/drm/pl111/pl111_debugfs.c |  2 +-
 drivers/gpu/drm/pl111/pl111_display.c |  2 +-
 .../gpu/drm/rockchip/dw-mipi-dsi-rockchip.c   |  4 +-
 drivers/gpu/drm/rockchip/rockchip_lvds.c  |  2 +-
 drivers/gpu/drm/rockchip/rockchip_rgb.c   |  1 +
 .../drm/selftests/test-drm_dp_mst_helper.c| 40 +--
 .../gpu/drm/selftests/test-drm_framebuffer.c  |  3 +-
 drivers/gpu/drm/selftests/test-drm_mm.c   |  2 +-
 drivers/gpu/drm/ttm/ttm_bo.c  | 23 ++-
 

[PATCH 06/43] drm/radeon/radeon_legacy_encoders: Move 'radeon_add_legacy_encoder' prototype to shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

  drivers/gpu/drm/radeon/radeon_legacy_encoders.c:1745:1: warning: no previous 
prototype for ‘radeon_add_legacy_encoder’ [-Wmissing-prototypes]
 1745 | radeon_add_legacy_encoder(struct drm_device *dev, uint32_t 
encoder_enum, uint32_t supported_device)
 | ^

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Sumit Semwal 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Cc: linux-me...@vger.kernel.org
Cc: linaro-mm-...@lists.linaro.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/radeon_encoders.c  |  4 +--
 .../gpu/drm/radeon/radeon_legacy_encoders.c   |  1 +
 .../gpu/drm/radeon/radeon_legacy_encoders.h   | 34 +++
 3 files changed, 36 insertions(+), 3 deletions(-)
 create mode 100644 drivers/gpu/drm/radeon/radeon_legacy_encoders.h

diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c 
b/drivers/gpu/drm/radeon/radeon_encoders.c
index ced022fae19d7..b60a373d3ead3 100644
--- a/drivers/gpu/drm/radeon/radeon_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_encoders.c
@@ -31,11 +31,9 @@
 #include 
 
 #include "radeon.h"
+#include "radeon_legacy_encoders.h"
 #include "atom.h"
 
-extern void
-radeon_legacy_backlight_init(struct radeon_encoder *radeon_encoder,
-struct drm_connector *drm_connector);
 extern void
 radeon_atom_backlight_init(struct radeon_encoder *radeon_encoder,
   struct drm_connector *drm_connector);
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c 
b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
index 44d060f75318e..e64fd0ce67070 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
@@ -35,6 +35,7 @@
 
 #include "radeon.h"
 #include "radeon_asic.h"
+#include "radeon_legacy_encoders.h"
 #include "atom.h"
 #ifdef CONFIG_PMAC_BACKLIGHT
 #include 
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.h 
b/drivers/gpu/drm/radeon/radeon_legacy_encoders.h
new file mode 100644
index 0..a80b387559d4d
--- /dev/null
+++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.h
@@ -0,0 +1,34 @@
+/* radeon_legacy_encoders.h -- Private header for radeon driver -*- linux-c -*-
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
+ * All rights reserved.
+ *
+ * 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef __RADEON_LEGACY_ENCODERS_H__
+#define __RADEON_LEGACY_ENCODERS_H__
+
+void radeon_legacy_backlight_init(struct radeon_encoder *radeon_encoder,
+ struct drm_connector *drm_connector);
+
+#endif /* __RADEON_LEGACY_ENCODERS_H__ */
-- 
2.25.1

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


[PATCH 04/43] drm/radeon/radeon_kms: Fix misnaming of 'radeon_info_ioctl's dev param

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_kms.c:226: warning: Function parameter or member 
'dev' not described in 'radeon_info_ioctl'
 drivers/gpu/drm/radeon/radeon_kms.c:226: warning: Excess function parameter 
'rdev' description in 'radeon_info_ioctl'

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/radeon_kms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_kms.c 
b/drivers/gpu/drm/radeon/radeon_kms.c
index 001940bca90a6..50cee4880bb46 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -214,7 +214,7 @@ static void radeon_set_filp_rights(struct drm_device *dev,
 /**
  * radeon_info_ioctl - answer a device specific request.
  *
- * @rdev: radeon device pointer
+ * @dev: drm device pointer
  * @data: request object
  * @filp: drm filp
  *
-- 
2.25.1

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


[PATCH 24/43] drm/radeon/r600: Move 'evergreen_rlc_resume()'s prototype to shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/evergreen.c:4380:5: warning: no previous prototype for 
‘evergreen_rlc_resume’ [-Wmissing-prototypes]
 4380 | int evergreen_rlc_resume(struct radeon_device *rdev)
 | ^~~~

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/evergreen.h | 1 +
 drivers/gpu/drm/radeon/r600.c  | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/evergreen.h 
b/drivers/gpu/drm/radeon/evergreen.h
index eb46ac7776951..f8d772e612a48 100644
--- a/drivers/gpu/drm/radeon/evergreen.h
+++ b/drivers/gpu/drm/radeon/evergreen.h
@@ -48,5 +48,6 @@ void evergreen_gpu_pci_config_reset(struct radeon_device 
*rdev);
 u32 evergreen_get_number_of_dram_channels(struct radeon_device *rdev);
 void evergreen_print_gpu_status_regs(struct radeon_device *rdev);
 u32 evergreen_gpu_check_soft_reset(struct radeon_device *rdev);
+int evergreen_rlc_resume(struct radeon_device *rdev);
 
 #endif /* __RADEON_EVERGREEN_H__ */
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index 94e8815e5067d..b44e0c607b1b1 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -39,6 +39,7 @@
 
 #include "atom.h"
 #include "avivod.h"
+#include "evergreen.h"
 #include "r600.h"
 #include "r600d.h"
 #include "rv770.h"
@@ -113,7 +114,6 @@ static void r600_gpu_init(struct radeon_device *rdev);
 void r600_fini(struct radeon_device *rdev);
 void r600_irq_disable(struct radeon_device *rdev);
 static void r600_pcie_gen2_enable(struct radeon_device *rdev);
-extern int evergreen_rlc_resume(struct radeon_device *rdev);
 
 /*
  * Indirect registers accessor
-- 
2.25.1

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


[PATCH 16/43] drm/radeon/radeon_gem: Move 'radeon_gem_prime_*()'s prototypes to shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_prime.c:34:18: warning: no previous prototype 
for ‘radeon_gem_prime_get_sg_table’ [-Wmissing-prototypes]
 34 | struct sg_table *radeon_gem_prime_get_sg_table(struct drm_gem_object *obj)
 | ^
 drivers/gpu/drm/radeon/radeon_prime.c:42:7: warning: no previous prototype for 
‘radeon_gem_prime_vmap’ [-Wmissing-prototypes]
 42 | void *radeon_gem_prime_vmap(struct drm_gem_object *obj)
 | ^
 drivers/gpu/drm/radeon/radeon_prime.c:55:6: warning: no previous prototype for 
‘radeon_gem_prime_vunmap’ [-Wmissing-prototypes]
 55 | void radeon_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr)
 | ^~~
 drivers/gpu/drm/radeon/radeon_prime.c:62:24: warning: no previous prototype 
for ‘radeon_gem_prime_import_sg_table’ [-Wmissing-prototypes]
 62 | struct drm_gem_object *radeon_gem_prime_import_sg_table(struct drm_device 
*dev,
 | ^~~~
 drivers/gpu/drm/radeon/radeon_prime.c:86:5: warning: no previous prototype for 
‘radeon_gem_prime_pin’ [-Wmissing-prototypes]
 86 | int radeon_gem_prime_pin(struct drm_gem_object *obj)
 | ^~~~
 drivers/gpu/drm/radeon/radeon_prime.c:104:6: warning: no previous prototype 
for ‘radeon_gem_prime_unpin’ [-Wmissing-prototypes]
 104 | void radeon_gem_prime_unpin(struct drm_gem_object *obj)
 | ^~
 drivers/gpu/drm/radeon/radeon_prime.c:120:17: warning: no previous prototype 
for ‘radeon_gem_prime_export’ [-Wmissing-prototypes]
 120 | struct dma_buf *radeon_gem_prime_export(struct drm_gem_object *gobj,
 | ^~~

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/radeon_gem.c   |  1 +
 drivers/gpu/drm/radeon/radeon_prime.c |  1 +
 drivers/gpu/drm/radeon/radeon_prime.h | 39 +++
 3 files changed, 41 insertions(+)
 create mode 100644 drivers/gpu/drm/radeon/radeon_prime.h

diff --git a/drivers/gpu/drm/radeon/radeon_gem.c 
b/drivers/gpu/drm/radeon/radeon_gem.c
index d2876ce3bc9e2..b6b21d2e72624 100644
--- a/drivers/gpu/drm/radeon/radeon_gem.c
+++ b/drivers/gpu/drm/radeon/radeon_gem.c
@@ -35,6 +35,7 @@
 #include 
 
 #include "radeon.h"
+#include "radeon_prime.h"
 
 struct dma_buf *radeon_gem_prime_export(struct drm_gem_object *gobj,
int flags);
diff --git a/drivers/gpu/drm/radeon/radeon_prime.c 
b/drivers/gpu/drm/radeon/radeon_prime.c
index 088d39a51c0d2..dd482edc819c5 100644
--- a/drivers/gpu/drm/radeon/radeon_prime.c
+++ b/drivers/gpu/drm/radeon/radeon_prime.c
@@ -30,6 +30,7 @@
 #include 
 
 #include "radeon.h"
+#include "radeon_prime.h"
 
 struct sg_table *radeon_gem_prime_get_sg_table(struct drm_gem_object *obj)
 {
diff --git a/drivers/gpu/drm/radeon/radeon_prime.h 
b/drivers/gpu/drm/radeon/radeon_prime.h
new file mode 100644
index 0..11b7f80987834
--- /dev/null
+++ b/drivers/gpu/drm/radeon/radeon_prime.h
@@ -0,0 +1,39 @@
+/* radeon_prime.h -- Private header for radeon driver -*- linux-c -*-
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
+ * All rights reserved.
+ *
+ * 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef __RADEON_PRIME_H__
+#define __RADEON_PRIME_H__
+
+struct dma_buf *radeon_gem_prime_export(struct drm_gem_object *gobj,
+   int flags);
+struct sg_table *radeon_gem_prime_get_sg_table(struct drm_gem_object *obj);
+int radeon_gem_prime_pin(struct drm_gem_object *obj);
+void radeon_gem_prime_unpin(struct drm_gem_object *obj);
+void *radeon_gem_prime_vmap(struct drm_gem_object *obj);
+void radeon_gem_prime_vunmap(struct drm_gem_object *obj, void 

[PATCH 23/43] drm/radeon/evergreen_dma: Move 'evergreen_gpu_check_soft_reset()'s prototype to shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/evergreen.c:3825:5: warning: no previous prototype for 
‘evergreen_gpu_check_soft_reset’ [-Wmissing-prototypes]
 3825 | u32 evergreen_gpu_check_soft_reset(struct radeon_device *rdev)
 | ^~

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/evergreen.h | 1 +
 drivers/gpu/drm/radeon/evergreen_dma.c | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/evergreen.h 
b/drivers/gpu/drm/radeon/evergreen.h
index 30c9ca99ced90..eb46ac7776951 100644
--- a/drivers/gpu/drm/radeon/evergreen.h
+++ b/drivers/gpu/drm/radeon/evergreen.h
@@ -47,5 +47,6 @@ int sumo_rlc_init(struct radeon_device *rdev);
 void evergreen_gpu_pci_config_reset(struct radeon_device *rdev);
 u32 evergreen_get_number_of_dram_channels(struct radeon_device *rdev);
 void evergreen_print_gpu_status_regs(struct radeon_device *rdev);
+u32 evergreen_gpu_check_soft_reset(struct radeon_device *rdev);
 
 #endif /* __RADEON_EVERGREEN_H__ */
diff --git a/drivers/gpu/drm/radeon/evergreen_dma.c 
b/drivers/gpu/drm/radeon/evergreen_dma.c
index 767857d4a8c5c..52c79da1ecf57 100644
--- a/drivers/gpu/drm/radeon/evergreen_dma.c
+++ b/drivers/gpu/drm/radeon/evergreen_dma.c
@@ -24,10 +24,9 @@
 
 #include "radeon.h"
 #include "radeon_asic.h"
+#include "evergreen.h"
 #include "evergreend.h"
 
-u32 evergreen_gpu_check_soft_reset(struct radeon_device *rdev);
-
 /**
  * evergreen_dma_fence_ring_emit - emit a fence on the DMA ring
  *
-- 
2.25.1

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


[PATCH 20/43] drm/radeon/evergreen: Move 'cayman_*()'s prototypes to shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/ni.c:1378:6: warning: no previous prototype for 
‘cayman_cp_int_cntl_setup’ [-Wmissing-prototypes]
 1378 | void cayman_cp_int_cntl_setup(struct radeon_device *rdev,
 | ^~~~
 drivers/gpu/drm/radeon/ni.c:1732:5: warning: no previous prototype for 
‘cayman_gpu_check_soft_reset’ [-Wmissing-prototypes]
 1732 | u32 cayman_gpu_check_soft_reset(struct radeon_device *rdev)
 | ^~~

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/evergreen.c |  5 +---
 drivers/gpu/drm/radeon/ni.c|  1 +
 drivers/gpu/drm/radeon/ni.h| 38 ++
 3 files changed, 40 insertions(+), 4 deletions(-)
 create mode 100644 drivers/gpu/drm/radeon/ni.h

diff --git a/drivers/gpu/drm/radeon/evergreen.c 
b/drivers/gpu/drm/radeon/evergreen.c
index f860f5ef2df88..8fb0b8c3db5b5 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -31,6 +31,7 @@
 
 #include "atom.h"
 #include "avivod.h"
+#include "ni.h"
 #include "rv770.h"
 #include "evergreen.h"
 #include "evergreen_blit_shaders.h"
@@ -215,10 +216,6 @@ static void evergreen_gpu_init(struct radeon_device *rdev);
 void evergreen_fini(struct radeon_device *rdev);
 void evergreen_pcie_gen2_enable(struct radeon_device *rdev);
 void evergreen_program_aspm(struct radeon_device *rdev);
-extern void cayman_cp_int_cntl_setup(struct radeon_device *rdev,
-int ring, u32 cp_int_cntl);
-extern void cayman_vm_decode_fault(struct radeon_device *rdev,
-  u32 status, u32 addr);
 void cik_init_cp_pg_table(struct radeon_device *rdev);
 
 extern u32 si_get_csb_size(struct radeon_device *rdev);
diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
index 1c9030a4631b8..ab7bd30802176 100644
--- a/drivers/gpu/drm/radeon/ni.c
+++ b/drivers/gpu/drm/radeon/ni.c
@@ -33,6 +33,7 @@
 #include "cayman_blit_shaders.h"
 #include "clearstate_cayman.h"
 #include "evergreen.h"
+#include "ni.h"
 #include "ni_reg.h"
 #include "nid.h"
 #include "radeon.h"
diff --git a/drivers/gpu/drm/radeon/ni.h b/drivers/gpu/drm/radeon/ni.h
new file mode 100644
index 0..d63be1c88c0f1
--- /dev/null
+++ b/drivers/gpu/drm/radeon/ni.h
@@ -0,0 +1,38 @@
+/* ni.h -- Private header for radeon driver -*- linux-c -*-
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
+ * All rights reserved.
+ *
+ * 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef __NI_H__
+#define __NI_H__
+
+struct radeon_device;
+
+void cayman_cp_int_cntl_setup(struct radeon_device *rdev,
+ int ring, u32 cp_int_cntl);
+void cayman_vm_decode_fault(struct radeon_device *rdev,
+   u32 status, u32 addr);
+
+#endif /* __NI_H__ */
-- 
2.25.1

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


[PATCH 01/42] drm/amd/amdgpu/atombios_encoders: Remove set but unused variable 'backlight_level'

2020-11-16 Thread Lee Jones
Also removing the call to amdgpu_atombios_encoder_get_backlight_level_from_reg()
since, according to Alex Deucher, "We call it again below indirectly".

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/amd/amdgpu/atombios_encoders.c: In function 
‘amdgpu_atombios_encoder_init_backlight’:
 drivers/gpu/drm/amd/amdgpu/atombios_encoders.c:174:5: warning: variable 
‘backlight_level’ set but not used [-Wunused-but-set-variable]

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Luben Tuikov 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/amd/amdgpu/atombios_encoders.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c 
b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
index fa817ebff9804..6134ed9640279 100644
--- a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
+++ b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
@@ -171,7 +171,6 @@ void amdgpu_atombios_encoder_init_backlight(struct 
amdgpu_encoder *amdgpu_encode
struct backlight_properties props;
struct amdgpu_backlight_privdata *pdata;
struct amdgpu_encoder_atom_dig *dig;
-   u8 backlight_level;
char bl_name[16];
 
/* Mac laptops with multiple GPUs use the gmux driver for backlight
@@ -207,8 +206,6 @@ void amdgpu_atombios_encoder_init_backlight(struct 
amdgpu_encoder *amdgpu_encode
 
pdata->encoder = amdgpu_encoder;
 
-   backlight_level = 
amdgpu_atombios_encoder_get_backlight_level_from_reg(adev);
-
dig = amdgpu_encoder->enc_priv;
dig->bl_dev = bd;
 
-- 
2.25.1

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


[PATCH 19/43] drm/radeon/ni_dpm: Move 'ni_get_{pi, ps}()'s into shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/ni_dpm.c:727:23: warning: no previous prototype for 
‘ni_get_pi’ [-Wmissing-prototypes]
 727 | struct ni_power_info *ni_get_pi(struct radeon_device *rdev)
 | ^
 drivers/gpu/drm/radeon/ni_dpm.c:734:15: warning: no previous prototype for 
‘ni_get_ps’ [-Wmissing-prototypes]
 734 | struct ni_ps *ni_get_ps(struct radeon_ps *rps)
 | ^

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/ni_dpm.h | 3 +++
 drivers/gpu/drm/radeon/si_dpm.c | 3 +--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/ni_dpm.h b/drivers/gpu/drm/radeon/ni_dpm.h
index 6bbee9180909e..74e3019369063 100644
--- a/drivers/gpu/drm/radeon/ni_dpm.h
+++ b/drivers/gpu/drm/radeon/ni_dpm.h
@@ -247,4 +247,7 @@ void ni_set_uvd_clock_after_set_eng_clock(struct 
radeon_device *rdev,
 
 bool ni_dpm_vblank_too_short(struct radeon_device *rdev);
 
+struct ni_power_info *ni_get_pi(struct radeon_device *rdev);
+struct ni_ps *ni_get_ps(struct radeon_ps *rps);
+
 #endif
diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c
index a80a21447a76d..c68ab2fb1ac23 100644
--- a/drivers/gpu/drm/radeon/si_dpm.c
+++ b/drivers/gpu/drm/radeon/si_dpm.c
@@ -30,6 +30,7 @@
 #include "rv770.h"
 #include "radeon.h"
 #include "radeon_asic.h"
+#include "ni_dpm.h"
 #include "si_dpm.h"
 #include "sid.h"
 
@@ -1719,8 +1720,6 @@ static const struct si_powertune_data 
powertune_data_hainan =
 };
 
 struct evergreen_power_info *evergreen_get_pi(struct radeon_device *rdev);
-struct ni_power_info *ni_get_pi(struct radeon_device *rdev);
-struct ni_ps *ni_get_ps(struct radeon_ps *rps);
 
 extern int si_mc_load_microcode(struct radeon_device *rdev);
 extern void vce_v1_0_enable_mgcg(struct radeon_device *rdev, bool enable);
-- 
2.25.1

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


[PATCH 35/43] drm/radeon/cik_sdma: Move 'amdgpu_cik_gpu_check_soft_reset()'s prototype to shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/cik.c:4845:5: warning: no previous prototype for 
‘cik_gpu_check_soft_reset’ [-Wmissing-prototypes]
 4845 | u32 cik_gpu_check_soft_reset(struct radeon_device *rdev)
 | ^~~~

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/cik.h  | 1 +
 drivers/gpu/drm/radeon/cik_sdma.c | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/cik.h b/drivers/gpu/drm/radeon/cik.h
index 297b3c1ff804f..6630b9da9e7aa 100644
--- a/drivers/gpu/drm/radeon/cik.h
+++ b/drivers/gpu/drm/radeon/cik.h
@@ -29,5 +29,6 @@ void cik_enter_rlc_safe_mode(struct radeon_device *rdev);
 void cik_exit_rlc_safe_mode(struct radeon_device *rdev);
 int ci_mc_load_microcode(struct radeon_device *rdev);
 void cik_update_cg(struct radeon_device *rdev, u32 block, bool enable);
+u32 cik_gpu_check_soft_reset(struct radeon_device *rdev);
 
 #endif /* __CIK_H__ */
diff --git a/drivers/gpu/drm/radeon/cik_sdma.c 
b/drivers/gpu/drm/radeon/cik_sdma.c
index 3c709ebe8d1ab..919b14845c3c7 100644
--- a/drivers/gpu/drm/radeon/cik_sdma.c
+++ b/drivers/gpu/drm/radeon/cik_sdma.c
@@ -27,14 +27,13 @@
 #include "radeon_ucode.h"
 #include "radeon_asic.h"
 #include "radeon_trace.h"
+#include "cik.h"
 #include "cikd.h"
 
 /* sdma */
 #define CIK_SDMA_UCODE_SIZE 1050
 #define CIK_SDMA_UCODE_VERSION 64
 
-u32 cik_gpu_check_soft_reset(struct radeon_device *rdev);
-
 /*
  * sDMA - System DMA
  * Starting with CIK, the GPU has new asynchronous
-- 
2.25.1

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


[PATCH 34/43] drm/radeon/evergreen: Move 'si_get_csb_*()'s prototypes to shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/si.c:5678:5: warning: no previous prototype for 
‘si_get_csb_size’ [-Wmissing-prototypes]
 5678 | u32 si_get_csb_size(struct radeon_device *rdev)
 | ^~~
 drivers/gpu/drm/radeon/si.c:5710:6: warning: no previous prototype for 
‘si_get_csb_buffer’ [-Wmissing-prototypes]
 5710 | void si_get_csb_buffer(struct radeon_device *rdev, volatile u32 *buffer)
 | ^

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/evergreen.c | 3 +--
 drivers/gpu/drm/radeon/si.h| 2 ++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/evergreen.c 
b/drivers/gpu/drm/radeon/evergreen.c
index 8fb0b8c3db5b5..4575e448e59df 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -41,6 +41,7 @@
 #include "radeon_asic.h"
 #include "radeon_audio.h"
 #include "radeon_ucode.h"
+#include "si.h"
 
 #define DC_HPDx_CONTROL(x)(DC_HPD1_CONTROL + (x * 0xc))
 #define DC_HPDx_INT_CONTROL(x)(DC_HPD1_INT_CONTROL + (x * 0xc))
@@ -218,8 +219,6 @@ void evergreen_pcie_gen2_enable(struct radeon_device *rdev);
 void evergreen_program_aspm(struct radeon_device *rdev);
 void cik_init_cp_pg_table(struct radeon_device *rdev);
 
-extern u32 si_get_csb_size(struct radeon_device *rdev);
-extern void si_get_csb_buffer(struct radeon_device *rdev, volatile u32 
*buffer);
 extern u32 cik_get_csb_size(struct radeon_device *rdev);
 extern void cik_get_csb_buffer(struct radeon_device *rdev, volatile u32 
*buffer);
 
diff --git a/drivers/gpu/drm/radeon/si.h b/drivers/gpu/drm/radeon/si.h
index f483a64d17050..310c58376f927 100644
--- a/drivers/gpu/drm/radeon/si.h
+++ b/drivers/gpu/drm/radeon/si.h
@@ -32,5 +32,7 @@ u32 si_gpu_check_soft_reset(struct radeon_device *rdev);
 void si_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc);
 void si_rlc_reset(struct radeon_device *rdev);
 void si_init_uvd_internal_cg(struct radeon_device *rdev);
+u32 si_get_csb_size(struct radeon_device *rdev);
+void si_get_csb_buffer(struct radeon_device *rdev, volatile u32 *buffer);
 
 #endif /* __SI_H__ */
-- 
2.25.1

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


[PATCH 08/43] drm/radeon/radeon_irq_kms: Demote non-conformant kernel-doc fix another

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_irq_kms.c:56: warning: Function parameter or 
member 'irq' not described in 'radeon_driver_irq_handler_kms'
 drivers/gpu/drm/radeon/radeon_irq_kms.c:56: warning: Function parameter or 
member 'arg' not described in 'radeon_driver_irq_handler_kms'
 drivers/gpu/drm/radeon/radeon_irq_kms.c:571: warning: Function parameter or 
member 'n' not described in 'radeon_irq_kms_set_irq_n_enabled'
 drivers/gpu/drm/radeon/radeon_irq_kms.c:571: warning: Excess function 
parameter 'num' description in 'radeon_irq_kms_set_irq_n_enabled'

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/radeon_irq_kms.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c 
b/drivers/gpu/drm/radeon/radeon_irq_kms.c
index b86bc88ad4308..a242b6053d47e 100644
--- a/drivers/gpu/drm/radeon/radeon_irq_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c
@@ -43,11 +43,9 @@
 
 #define RADEON_WAIT_IDLE_TIMEOUT 200
 
-/**
+/*
  * radeon_driver_irq_handler_kms - irq handler for KMS
  *
- * @int irq, void *arg: args
- *
  * This is the irq handler for the radeon KMS driver (all asics).
  * radeon_irq_process is a macro that points to the per-asic
  * irq handler callback.
@@ -549,14 +547,14 @@ void radeon_irq_kms_disable_hpd(struct radeon_device 
*rdev, unsigned hpd_mask)
 }
 
 /**
- * radeon_irq_kms_update_int_n - helper for updating interrupt enable registers
+ * radeon_irq_kms_set_irq_n_enabled - helper for updating interrupt enable 
registers
  *
  * @rdev: radeon device pointer
  * @reg: the register to write to enable/disable interrupts
  * @mask: the mask that enables the interrupts
  * @enable: whether to enable or disable the interrupt register
  * @name: the name of the interrupt register to print to the kernel log
- * @num: the number of the interrupt register to print to the kernel log
+ * @n: the number of the interrupt register to print to the kernel log
  *
  * Helper for updating the enable state of interrupt registers. Checks whether
  * or not the interrupt matches the enable state we want. If it doesn't, then
-- 
2.25.1

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


[PATCH 32/43] drm/radeon/btc_dpm: Move 'evergreen_get_pi's prototype to shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/rv770_dpm.c:62:30: warning: no previous prototype for 
‘evergreen_get_pi’ [-Wmissing-prototypes]
 62 | struct evergreen_power_info *evergreen_get_pi(struct radeon_device *rdev)
 | ^~~~

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/btc_dpm.c | 3 +--
 drivers/gpu/drm/radeon/cypress_dpm.c | 3 +--
 drivers/gpu/drm/radeon/evergreen.h   | 2 ++
 drivers/gpu/drm/radeon/ni_dpm.c  | 3 +--
 drivers/gpu/drm/radeon/rv770_dpm.c   | 1 +
 drivers/gpu/drm/radeon/si_dpm.c  | 3 +--
 6 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/radeon/btc_dpm.c b/drivers/gpu/drm/radeon/btc_dpm.c
index 018949668536e..4e64ed38c439f 100644
--- a/drivers/gpu/drm/radeon/btc_dpm.c
+++ b/drivers/gpu/drm/radeon/btc_dpm.c
@@ -29,6 +29,7 @@
 #include "btc_dpm.h"
 #include "btcd.h"
 #include "cypress_dpm.h"
+#include "evergreen.h"
 #include "r600_dpm.h"
 #include "rv770.h"
 #include "radeon.h"
@@ -49,8 +50,6 @@
 #ifndef BTC_MGCG_SEQUENCE
 #define BTC_MGCG_SEQUENCE  300
 
-struct evergreen_power_info *evergreen_get_pi(struct radeon_device *rdev);
-
 extern int ni_mc_load_microcode(struct radeon_device *rdev);
 
 //* BARTS **//
diff --git a/drivers/gpu/drm/radeon/cypress_dpm.c 
b/drivers/gpu/drm/radeon/cypress_dpm.c
index 6d3690bcca2d2..fdddbbaecbb74 100644
--- a/drivers/gpu/drm/radeon/cypress_dpm.c
+++ b/drivers/gpu/drm/radeon/cypress_dpm.c
@@ -26,6 +26,7 @@
 
 #include "atom.h"
 #include "cypress_dpm.h"
+#include "evergreen.h"
 #include "evergreend.h"
 #include "r600_dpm.h"
 #include "rv770.h"
@@ -44,8 +45,6 @@
 #define MC_CG_SEQ_YCLK_SUSPEND  0x04
 #define MC_CG_SEQ_YCLK_RESUME   0x0a
 
-struct evergreen_power_info *evergreen_get_pi(struct radeon_device *rdev);
-
 static void cypress_enable_bif_dynamic_pcie_gen2(struct radeon_device *rdev,
 bool enable)
 {
diff --git a/drivers/gpu/drm/radeon/evergreen.h 
b/drivers/gpu/drm/radeon/evergreen.h
index f8d772e612a48..a829deb8b078a 100644
--- a/drivers/gpu/drm/radeon/evergreen.h
+++ b/drivers/gpu/drm/radeon/evergreen.h
@@ -29,6 +29,7 @@
 #define __RADEON_EVERGREEN_H__
 
 struct evergreen_mc_save;
+struct evergreen_power_info;
 struct radeon_device;
 
 bool evergreen_is_display_hung(struct radeon_device *rdev);
@@ -49,5 +50,6 @@ u32 evergreen_get_number_of_dram_channels(struct 
radeon_device *rdev);
 void evergreen_print_gpu_status_regs(struct radeon_device *rdev);
 u32 evergreen_gpu_check_soft_reset(struct radeon_device *rdev);
 int evergreen_rlc_resume(struct radeon_device *rdev);
+struct evergreen_power_info *evergreen_get_pi(struct radeon_device *rdev);
 
 #endif /* __RADEON_EVERGREEN_H__ */
diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c
index d39bbd9793cc2..dd5ef64937230 100644
--- a/drivers/gpu/drm/radeon/ni_dpm.c
+++ b/drivers/gpu/drm/radeon/ni_dpm.c
@@ -26,6 +26,7 @@
 #include 
 
 #include "atom.h"
+#include "evergreen.h"
 #include "ni_dpm.h"
 #include "nid.h"
 #include "r600_dpm.h"
@@ -720,8 +721,6 @@ static const u32 cayman_sysls_enable[] =
 };
 #define CAYMAN_SYSLS_ENABLE_LENGTH sizeof(cayman_sysls_enable) / (3 * 
sizeof(u32))
 
-struct evergreen_power_info *evergreen_get_pi(struct radeon_device *rdev);
-
 extern int ni_mc_load_microcode(struct radeon_device *rdev);
 
 struct ni_power_info *ni_get_pi(struct radeon_device *rdev)
diff --git a/drivers/gpu/drm/radeon/rv770_dpm.c 
b/drivers/gpu/drm/radeon/rv770_dpm.c
index badd8ac6e038f..ef2f1a048cfed 100644
--- a/drivers/gpu/drm/radeon/rv770_dpm.c
+++ b/drivers/gpu/drm/radeon/rv770_dpm.c
@@ -30,6 +30,7 @@
 #include "rv770_dpm.h"
 #include "cypress_dpm.h"
 #include "atom.h"
+#include "evergreen.h"
 #include 
 
 #define MC_CG_ARB_FREQ_F0   0x0a
diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c
index 32b697965c064..b4581392fbce9 100644
--- a/drivers/gpu/drm/radeon/si_dpm.c
+++ b/drivers/gpu/drm/radeon/si_dpm.c
@@ -26,6 +26,7 @@
 #include 
 
 #include "atom.h"
+#include "evergreen.h"
 #include "r600_dpm.h"
 #include "rv770.h"
 #include "radeon.h"
@@ -1720,8 +1721,6 @@ static const struct si_powertune_data 
powertune_data_hainan =
true
 };
 
-struct evergreen_power_info *evergreen_get_pi(struct radeon_device *rdev);
-
 extern void vce_v1_0_enable_mgcg(struct radeon_device *rdev, bool enable);
 
 static int si_populate_voltage_value(struct radeon_device *rdev,
-- 
2.25.1

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


[PATCH 12/43] drm/radeon/evergreen: Move 'evergreen_*' and 'sumo_*' prototypes out to shared location

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/evergreen.c:1281:6: warning: no previous prototype for 
‘evergreen_fix_pci_max_read_req_size’ [-Wmissing-prototypes]
 1281 | void evergreen_fix_pci_max_read_req_size(struct radeon_device *rdev)
 | ^~~
 drivers/gpu/drm/radeon/evergreen.c:2664:6: warning: no previous prototype for 
‘evergreen_mc_stop’ [-Wmissing-prototypes]
 2664 | void evergreen_mc_stop(struct radeon_device *rdev, struct 
evergreen_mc_save *save)
 | ^
 drivers/gpu/drm/radeon/evergreen.c:2762:6: warning: no previous prototype for 
‘evergreen_mc_resume’ [-Wmissing-prototypes]
 2762 | void evergreen_mc_resume(struct radeon_device *rdev, struct 
evergreen_mc_save *save)
 | ^~~
 drivers/gpu/drm/radeon/evergreen.c:2850:6: warning: no previous prototype for 
‘evergreen_mc_program’ [-Wmissing-prototypes]
 2850 | void evergreen_mc_program(struct radeon_device *rdev)
 | ^~~~
 drivers/gpu/drm/radeon/evergreen.c:3710:5: warning: no previous prototype for 
‘evergreen_mc_init’ [-Wmissing-prototypes]
 3710 | int evergreen_mc_init(struct radeon_device *rdev)
 | ^
 drivers/gpu/drm/radeon/evergreen.c:3769:6: warning: no previous prototype for 
‘evergreen_print_gpu_status_regs’ [-Wmissing-prototypes]
 3769 | void evergreen_print_gpu_status_regs(struct radeon_device *rdev)
 | ^~~
 drivers/gpu/drm/radeon/evergreen.c:3797:6: warning: no previous prototype for 
‘evergreen_is_display_hung’ [-Wmissing-prototypes]
 3797 | bool evergreen_is_display_hung(struct radeon_device *rdev)
 | ^
 drivers/gpu/drm/radeon/evergreen.c:4009:6: warning: no previous prototype for 
‘evergreen_gpu_pci_config_reset’ [-Wmissing-prototypes]
 4009 | void evergreen_gpu_pci_config_reset(struct radeon_device *rdev)
 | ^~
 drivers/gpu/drm/radeon/evergreen.c:4110:6: warning: no previous prototype for 
‘sumo_rlc_fini’ [-Wmissing-prototypes]
 4110 | void sumo_rlc_fini(struct radeon_device *rdev)
 | ^
 drivers/gpu/drm/radeon/evergreen.c:4153:5: warning: no previous prototype for 
‘sumo_rlc_init’ [-Wmissing-prototypes]
 4153 | int sumo_rlc_init(struct radeon_device *rdev)
 | ^
 drivers/gpu/drm/radeon/evergreen.c:4381:5: warning: no previous prototype for 
‘evergreen_rlc_resume’ [-Wmissing-prototypes]
 4381 | int evergreen_rlc_resume(struct radeon_device *rdev)
 | ^
 drivers/gpu/drm/radeon/evergreen.c:4670:6: warning: no previous prototype for 
‘evergreen_irq_suspend’ [-Wmissing-prototypes]
 4670 | void evergreen_irq_suspend(struct radeon_device *rdev)
 | ^

NB: Lots more of these - snipped for brevity

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/cik.c   |  6 +---
 drivers/gpu/drm/radeon/evergreen.c |  1 +
 drivers/gpu/drm/radeon/evergreen.h | 51 ++
 drivers/gpu/drm/radeon/ni.c| 16 +-
 drivers/gpu/drm/radeon/si.c|  7 +---
 5 files changed, 55 insertions(+), 26 deletions(-)
 create mode 100644 drivers/gpu/drm/radeon/evergreen.h

diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index abf370e16bd9f..315c4f3df3656 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -30,6 +30,7 @@
 #include 
 
 #include "atom.h"
+#include "evergreen.h"
 #include "cik_blit_shaders.h"
 #include "cikd.h"
 #include "clearstate_ci.h"
@@ -126,11 +127,6 @@ MODULE_FIRMWARE("radeon/mullins_sdma.bin");
 
 extern int r600_ih_ring_alloc(struct radeon_device *rdev);
 extern void r600_ih_ring_fini(struct radeon_device *rdev);
-extern void evergreen_mc_stop(struct radeon_device *rdev, struct 
evergreen_mc_save *save);
-extern void evergreen_mc_resume(struct radeon_device *rdev, struct 
evergreen_mc_save *save);
-extern bool evergreen_is_display_hung(struct radeon_device *rdev);
-extern void sumo_rlc_fini(struct radeon_device *rdev);
-extern int sumo_rlc_init(struct radeon_device *rdev);
 extern void si_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc 
*mc);
 extern void si_rlc_reset(struct radeon_device *rdev);
 extern void si_init_uvd_internal_cg(struct radeon_device *rdev);
diff --git a/drivers/gpu/drm/radeon/evergreen.c 
b/drivers/gpu/drm/radeon/evergreen.c
index 9a1e240b07234..f860f5ef2df88 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -32,6 +32,7 @@
 #include "atom.h"
 #include "avivod.h"
 #include "rv770.h"
+#include "evergreen.h"
 #include "evergreen_blit_shaders.h"
 #include "evergreen_reg.h"
 #include "evergreend.h"
diff --git a/drivers/gpu/drm/radeon/evergreen.h 
b/drivers/gpu/drm/radeon/evergreen.h
new file mode 100644
index 0..30c9ca99ced90
--- /dev/null
+++ 

[PATCH 05/43] drm/radeon: Move radeon_ttm{init, fini} to shared location

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_ttm.c: At top level:
 drivers/gpu/drm/radeon/radeon_ttm.c:817:5: warning: no previous prototype for 
‘radeon_ttm_init’ [-Wmissing-prototypes]
 817 | int radeon_ttm_init(struct radeon_device *rdev)
 | ^~~
 drivers/gpu/drm/radeon/radeon_ttm.c:878:6: warning: no previous prototype for 
‘radeon_ttm_fini’ [-Wmissing-prototypes]
 878 | void radeon_ttm_fini(struct radeon_device *rdev)
 | ^~~

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Sumit Semwal 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Cc: linux-me...@vger.kernel.org
Cc: linaro-mm-...@lists.linaro.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/radeon_object.c |  3 +--
 drivers/gpu/drm/radeon/radeon_ttm.c|  1 +
 drivers/gpu/drm/radeon/radeon_ttm.h| 36 ++
 3 files changed, 38 insertions(+), 2 deletions(-)
 create mode 100644 drivers/gpu/drm/radeon/radeon_ttm.h

diff --git a/drivers/gpu/drm/radeon/radeon_object.c 
b/drivers/gpu/drm/radeon/radeon_object.c
index ab81e35cb0606..8bc5ad1d65857 100644
--- a/drivers/gpu/drm/radeon/radeon_object.c
+++ b/drivers/gpu/drm/radeon/radeon_object.c
@@ -40,9 +40,8 @@
 
 #include "radeon.h"
 #include "radeon_trace.h"
+#include "radeon_ttm.h"
 
-int radeon_ttm_init(struct radeon_device *rdev);
-void radeon_ttm_fini(struct radeon_device *rdev);
 static void radeon_bo_clear_surface_reg(struct radeon_bo *bo);
 
 /*
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c 
b/drivers/gpu/drm/radeon/radeon_ttm.c
index 2939e71ceb700..28b300ed200ea 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -51,6 +51,7 @@
 
 #include "radeon_reg.h"
 #include "radeon.h"
+#include "radeon_ttm.h"
 
 static int radeon_ttm_debugfs_init(struct radeon_device *rdev);
 static void radeon_ttm_debugfs_fini(struct radeon_device *rdev);
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.h 
b/drivers/gpu/drm/radeon/radeon_ttm.h
new file mode 100644
index 0..91ea7141bc812
--- /dev/null
+++ b/drivers/gpu/drm/radeon/radeon_ttm.h
@@ -0,0 +1,36 @@
+/* radeon_ttm.h -- Private header for radeon driver -*- linux-c -*-
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
+ * All rights reserved.
+ *
+ * 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef __RADEON_TTM_H__
+#define __RADEON_TTM_H__
+
+struct radeon_device;
+
+int radeon_ttm_init(struct radeon_device *rdev);
+void radeon_ttm_fini(struct radeon_device *rdev);
+
+#endif /* __RADEON_TTM_H__ */
-- 
2.25.1

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


[PATCH 40/43] drm/radeon/cik: Move 'vce_v2_0_enable_mgcg()'s prototype to shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/vce_v2_0.c:111:6: warning: no previous prototype for 
‘vce_v2_0_enable_mgcg’ [-Wmissing-prototypes]
 111 | void vce_v2_0_enable_mgcg(struct radeon_device *rdev, bool enable)
 | ^~~~

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Sumit Semwal 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Cc: linux-me...@vger.kernel.org
Cc: linaro-mm-...@lists.linaro.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/cik.c  | 2 +-
 drivers/gpu/drm/radeon/vce.h  | 1 +
 drivers/gpu/drm/radeon/vce_v2_0.c | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index 2af76463906ad..8b7a4f7b75766 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -41,6 +41,7 @@
 #include "radeon_audio.h"
 #include "radeon_ucode.h"
 #include "si.h"
+#include "vce.h"
 
 #define SH_MEM_CONFIG_GFX_DEFAULT \
ALIGNMENT_MODE(SH_MEM_ALIGNMENT_MODE_UNALIGNED)
@@ -129,7 +130,6 @@ MODULE_FIRMWARE("radeon/mullins_rlc.bin");
 MODULE_FIRMWARE("radeon/mullins_sdma.bin");
 
 static u32 cik_get_cu_active_bitmap(struct radeon_device *rdev, u32 se, u32 
sh);
-extern void vce_v2_0_enable_mgcg(struct radeon_device *rdev, bool enable);
 static void cik_rlc_stop(struct radeon_device *rdev);
 static void cik_pcie_gen3_enable(struct radeon_device *rdev);
 static void cik_program_aspm(struct radeon_device *rdev);
diff --git a/drivers/gpu/drm/radeon/vce.h b/drivers/gpu/drm/radeon/vce.h
index 1eb4f5715202e..ccc9c00f0d02c 100644
--- a/drivers/gpu/drm/radeon/vce.h
+++ b/drivers/gpu/drm/radeon/vce.h
@@ -30,5 +30,6 @@
 struct radeon_device;
 
 void vce_v1_0_enable_mgcg(struct radeon_device *rdev, bool enable);
+void vce_v2_0_enable_mgcg(struct radeon_device *rdev, bool enable);
 
 #endif /* __VCE_H__ */
diff --git a/drivers/gpu/drm/radeon/vce_v2_0.c 
b/drivers/gpu/drm/radeon/vce_v2_0.c
index d6fde3659e65f..163c9bfc03da8 100644
--- a/drivers/gpu/drm/radeon/vce_v2_0.c
+++ b/drivers/gpu/drm/radeon/vce_v2_0.c
@@ -30,6 +30,7 @@
 #include "radeon.h"
 #include "radeon_asic.h"
 #include "cikd.h"
+#include "vce.h"
 
 #define VCE_V2_0_FW_SIZE   (256 * 1024)
 #define VCE_V2_0_STACK_SIZE(64 * 1024)
-- 
2.25.1

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


[PATCH v2 00/42] Rid W=1 warnings from GPU (non-Radeon)

2020-11-16 Thread Lee Jones
[sending again, as `git send-email` crashed!]

This set contains fixes for some "wouldn't it be nice if" issues,
however most of the patches seen here have been on the MLs, but
were left unreviewed.

Lee Jones (42):
  drm/amd/amdgpu/atombios_encoders: Remove set but unused variable
'backlight_level'
  drm/armada/armada_overlay: Staticify local function
'armada_overlay_duplicate_state'
  drm/drm_dp_mst_topology: Remove set but never used variable 'len'
  drm/exynos/exynos7_drm_decon: Supply missing description for  param
'ctx'
  drm/exynos/exynos_drm_fimd: Add missing description for param 'ctx'
  drm/exynos/exynos_drm_gsc: Supply missing description for 'num_limits'
  drm/mediatek/mtk_dpi: Remove unused struct definition
'mtk_dpi_encoder_funcs'
  drm/mediatek/mtk_disp_color: Fix formatting and provide missing member
description
  drm/mediatek/mtk_disp_ovl: Fix formatting and provide missing member
description
  drm/mediatek/mtk_disp_rdma: Fix formatting and supply missing struct
member description
  drm/mediatek/mtk_drm_crtc: Demote seriously out-of-date struct header
  drm/mediatek/mtk_drm_drv: Staticise local function invoked by
reference
  drm/meson/meson_venc: Make local function
'meson_venc_hdmi_get_dmt_vmode' static
  drm/meson/meson_vclk: Make two local functions static
  drm/msm/adreno/a6xx_gpu: Staticise local function 'a6xx_idle'
  drm/msm/disp/mdp5/mdp5_crtc: Make local function
'mdp5_crtc_setup_pipeline()' static
  drm/msm/disp/mdp5/mdp5_ctl: Demote non-conformant kernel-doc headers
  drm/msm/disp/mdp5/mdp5_kms: Make local functions 'mdp5_{en,dis}able()'
static
  drm/msm/disp/dpu1/dpu_core_perf: Remove set but unused variable
'dpu_cstate'
  drm/msm/disp/dpu1/dpu_encoder: Remove a bunch of unused variables
  drm/nouveau/nvkm/core/firmware: Fix formatting, provide missing param
description
  drm/pl111/pl111_display: Make local function static
  drm/pl111/pl111_debugfs: Make local function 'pl111_debugfs_regs()'
static
  drm/rockchip/dw-mipi-dsi-rockchip: Demote non-conformant kernel-doc
headers
  drm/rockchip/rockchip_rgb: Consume our own header
  drm/rockchip/rockchip_lvds: Fix struct document formatting
  drm/selftests/test-drm_mm: Mark 'hole_end' as always_unused
  drm/selftests/test-drm_framebuffer: Remove set but unused variable
'fb'
  drm/selftests/test-drm_dp_mst_helper: Place 'struct
drm_dp_sideband_msg_req_body' onto the heap
  drm/selftests/test-drm_dp_mst_helper: Move
'sideband_msg_req_encode_decode' onto the heap
  drm/ttm/ttm_bo: Fix one function header - demote lots of kernel-doc
abuses
  drm/ttm/ttm_tt: Demote kernel-doc header format abuses
  drm/ttm/ttm_range_manager: Demote non-conformant kernel-doc header
  drm/v3d/v3d_drv: Remove unused static variable 'v3d_v3d_pm_ops'
  drm/v3d/v3d_gem: Provide descriptions for 'v3d_lookup_bos's params
  drm/v3d/v3d_sched: Demote non-conformant kernel-doc header
  drm/vc4/vc4_hdmi_regs: Mark some data sets as __maybe_unused
  drm/vc4/vc4_hdmi: Remove set but unused variable 'ret'
  drm/vc4/vc4_v3d: Demote non-conformant kernel-doc headers
  drm/vc4/vc4_debugfs: Demote non-conformant kernel-doc headers
  gpu/ipu-v3/ipu-di: Strip out 2 unused 'di_sync_config' entries
  include/drm/drm_atomic: Make use of 'new_crtc_state'

 .../gpu/drm/amd/amdgpu/atombios_encoders.c|  3 --
 drivers/gpu/drm/armada/armada_overlay.c   |  2 +-
 drivers/gpu/drm/drm_dp_mst_topology.c |  4 +-
 drivers/gpu/drm/exynos/exynos7_drm_decon.c|  1 +
 drivers/gpu/drm/exynos/exynos_drm_fimd.c  |  1 +
 drivers/gpu/drm/exynos/exynos_drm_gsc.c   |  1 +
 drivers/gpu/drm/mediatek/mtk_disp_color.c |  5 ++-
 drivers/gpu/drm/mediatek/mtk_disp_ovl.c   |  5 ++-
 drivers/gpu/drm/mediatek/mtk_disp_rdma.c  |  5 ++-
 drivers/gpu/drm/mediatek/mtk_dpi.c|  9 -
 drivers/gpu/drm/mediatek/mtk_drm_crtc.c   |  4 +-
 drivers/gpu/drm/mediatek/mtk_drm_drv.c|  4 +-
 drivers/gpu/drm/meson/meson_vclk.c|  8 ++--
 drivers/gpu/drm/meson/meson_venc.c|  4 +-
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c |  2 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c |  3 --
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c   | 12 +-
 drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c |  6 +--
 drivers/gpu/drm/msm/disp/mdp5/mdp5_ctl.c  |  6 +--
 drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c  |  4 +-
 drivers/gpu/drm/nouveau/nvkm/core/firmware.c  |  9 +++--
 drivers/gpu/drm/pl111/pl111_debugfs.c |  2 +-
 drivers/gpu/drm/pl111/pl111_display.c |  2 +-
 .../gpu/drm/rockchip/dw-mipi-dsi-rockchip.c   |  4 +-
 drivers/gpu/drm/rockchip/rockchip_lvds.c  |  2 +-
 drivers/gpu/drm/rockchip/rockchip_rgb.c   |  1 +
 .../drm/selftests/test-drm_dp_mst_helper.c| 40 +--
 .../gpu/drm/selftests/test-drm_framebuffer.c  |  3 +-
 drivers/gpu/drm/selftests/test-drm_mm.c   |  2 +-
 drivers/gpu/drm/ttm/ttm_bo.c  | 23 

[PATCH 27/43] drm/radeon/radeon_encoders: Move 'radeon_atom_backlight_init's prototype to shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/atombios_encoders.c:186:6: warning: no previous 
prototype for ‘radeon_atom_backlight_init’ [-Wmissing-prototypes]
 186 | void radeon_atom_backlight_init(struct radeon_encoder *radeon_encoder,
 | ^~

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/radeon_atombios.h | 4 
 drivers/gpu/drm/radeon/radeon_encoders.c | 6 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_atombios.h 
b/drivers/gpu/drm/radeon/radeon_atombios.h
index a895a7002c3d3..fd03755e6fa2c 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.h
+++ b/drivers/gpu/drm/radeon/radeon_atombios.h
@@ -28,14 +28,18 @@
 #ifndef __RADEON_ATOMBIOS_H__
 #define __RADEON_ATOMBIOS_H__
 
+struct drm_connector;
 struct drm_device;
 struct drm_display_mode;
 struct radeon_device;
+struct radeon_encoder;
 
 bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index,
struct drm_display_mode *mode);
 void radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_enum,
 uint32_t supported_device, u16 caps);
+void radeon_atom_backlight_init(struct radeon_encoder *radeon_encoder,
+   struct drm_connector *drm_connector);
 
 
 #endif /* __RADEON_ATOMBIOS_H__ */
diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c 
b/drivers/gpu/drm/radeon/radeon_encoders.c
index b60a373d3ead3..46549d5179ee9 100644
--- a/drivers/gpu/drm/radeon/radeon_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_encoders.c
@@ -31,14 +31,10 @@
 #include 
 
 #include "radeon.h"
+#include "radeon_atombios.h"
 #include "radeon_legacy_encoders.h"
 #include "atom.h"
 
-extern void
-radeon_atom_backlight_init(struct radeon_encoder *radeon_encoder,
-  struct drm_connector *drm_connector);
-
-
 static uint32_t radeon_encoder_clones(struct drm_encoder *encoder)
 {
struct drm_device *dev = encoder->dev;
-- 
2.25.1

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


[PATCH 42/43] drm/radeon/radeon_audio: Move 'r600_*' prototypes into shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/r600_hdmi.c:177:6: warning: no previous prototype for 
‘r600_hdmi_update_acr’ [-Wmissing-prototypes]
 177 | void r600_hdmi_update_acr(struct drm_encoder *encoder, long offset,
 | ^~~~
 drivers/gpu/drm/radeon/r600_hdmi.c:217:6: warning: no previous prototype for 
‘r600_set_avi_packet’ [-Wmissing-prototypes]
 217 | void r600_set_avi_packet(struct radeon_device *rdev, u32 offset,
 | ^~~
 drivers/gpu/drm/radeon/r600_hdmi.c:314:6: warning: no previous prototype for 
‘r600_hdmi_audio_set_dto’ [-Wmissing-prototypes]
 314 | void r600_hdmi_audio_set_dto(struct radeon_device *rdev,
 | ^~~
 drivers/gpu/drm/radeon/r600_hdmi.c:340:6: warning: no previous prototype for 
‘r600_set_vbi_packet’ [-Wmissing-prototypes]
 340 | void r600_set_vbi_packet(struct drm_encoder *encoder, u32 offset)
 | ^~~
 drivers/gpu/drm/radeon/r600_hdmi.c:351:6: warning: no previous prototype for 
‘r600_set_audio_packet’ [-Wmissing-prototypes]
 351 | void r600_set_audio_packet(struct drm_encoder *encoder, u32 offset)
 | ^
 drivers/gpu/drm/radeon/r600_hdmi.c:393:6: warning: no previous prototype for 
‘r600_set_mute’ [-Wmissing-prototypes]
 393 | void r600_set_mute(struct drm_encoder *encoder, u32 offset, bool mute)
 | ^
 drivers/gpu/drm/radeon/r600_hdmi.c:469:6: warning: no previous prototype for 
‘r600_hdmi_enable’ [-Wmissing-prototypes]
 469 | void r600_hdmi_enable(struct drm_encoder *encoder, bool enable)
 | ^~~~

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/r600.h | 17 +
 drivers/gpu/drm/radeon/r600_hdmi.c|  1 +
 drivers/gpu/drm/radeon/radeon_audio.c | 13 +
 3 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/radeon/r600.h b/drivers/gpu/drm/radeon/r600.h
index dbdff4568516b..22db13b256195 100644
--- a/drivers/gpu/drm/radeon/r600.h
+++ b/drivers/gpu/drm/radeon/r600.h
@@ -30,12 +30,29 @@
 
 struct radeon_bo_list;
 struct radeon_cs_parser;
+struct r600_audio_pin;
+struct radeon_crtc;
 struct radeon_device;
+struct radeon_hdmi_acr;
 
 u32 r600_gpu_check_soft_reset(struct radeon_device *rdev);
 int r600_ih_ring_alloc(struct radeon_device *rdev);
 void r600_ih_ring_fini(struct radeon_device *rdev);
 
+void r600_audio_enable(struct radeon_device *rdev, struct r600_audio_pin *pin,
+  u8 enable_mask);
+void r600_set_audio_packet(struct drm_encoder *encoder, u32 offset);
+void r600_set_mute(struct drm_encoder *encoder, u32 offset, bool mute);
+void r600_hdmi_audio_set_dto(struct radeon_device *rdev,
+struct radeon_crtc *crtc, unsigned int clock);
+void r600_set_avi_packet(struct radeon_device *rdev, u32 offset,
+unsigned char *buffer, size_t size);
+void r600_hdmi_update_acr(struct drm_encoder *encoder, long offset,
+ const struct radeon_hdmi_acr *acr);
+void r600_set_vbi_packet(struct drm_encoder *encoder, u32 offset);
+void r600_hdmi_enable(struct drm_encoder *encoder, bool enable);
+
 int r600_dma_cs_next_reloc(struct radeon_cs_parser *p,
   struct radeon_bo_list **cs_reloc);
+
 #endif /* __R600_H__ */
diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c 
b/drivers/gpu/drm/radeon/r600_hdmi.c
index c09549d785b54..f3551ebaa2f08 100644
--- a/drivers/gpu/drm/radeon/r600_hdmi.c
+++ b/drivers/gpu/drm/radeon/r600_hdmi.c
@@ -30,6 +30,7 @@
 #include "radeon.h"
 #include "radeon_asic.h"
 #include "radeon_audio.h"
+#include "r600.h"
 #include "r600d.h"
 #include "atom.h"
 
diff --git a/drivers/gpu/drm/radeon/radeon_audio.c 
b/drivers/gpu/drm/radeon/radeon_audio.c
index 785c23cb30589..7c5e80d03fc90 100644
--- a/drivers/gpu/drm/radeon/radeon_audio.c
+++ b/drivers/gpu/drm/radeon/radeon_audio.c
@@ -29,28 +29,17 @@
 #include "evergreen_hdmi.h"
 #include "radeon.h"
 #include "atom.h"
+#include "r600.h"
 #include "radeon_audio.h"
 
-void r600_audio_enable(struct radeon_device *rdev, struct r600_audio_pin *pin,
-   u8 enable_mask);
 void dce6_audio_enable(struct radeon_device *rdev, struct r600_audio_pin *pin,
u8 enable_mask);
 struct r600_audio_pin* r600_audio_get_pin(struct radeon_device *rdev);
 struct r600_audio_pin* dce6_audio_get_pin(struct radeon_device *rdev);
-void r600_hdmi_audio_set_dto(struct radeon_device *rdev,
-   struct radeon_crtc *crtc, unsigned int clock);
-void r600_set_avi_packet(struct radeon_device *rdev, u32 offset,
-   unsigned char *buffer, size_t size);
-void r600_hdmi_update_acr(struct drm_encoder *encoder, long offset,
-   const struct radeon_hdmi_acr *acr);
-void r600_set_vbi_packet(struct drm_encoder *encoder, u32 offset);
-void r600_set_audio_packet(struct 

[PATCH 22/43] drm/radeon/cik: Move 'r600_ih_ring_{alloc, fini}()'s prototypes to shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/r600.c:3480:5: warning: no previous prototype for 
‘r600_ih_ring_alloc’ [-Wmissing-prototypes]
 3480 | int r600_ih_ring_alloc(struct radeon_device *rdev)
 | ^~
 drivers/gpu/drm/radeon/r600.c:3516:6: warning: no previous prototype for 
‘r600_ih_ring_fini’ [-Wmissing-prototypes]
 3516 | void r600_ih_ring_fini(struct radeon_device *rdev)
 | ^

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Sumit Semwal 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Cc: linux-me...@vger.kernel.org
Cc: linaro-mm-...@lists.linaro.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/cik.c  | 3 +--
 drivers/gpu/drm/radeon/r600.h | 2 ++
 drivers/gpu/drm/radeon/si.c   | 3 +--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index 315c4f3df3656..980b50d046cbc 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -34,6 +34,7 @@
 #include "cik_blit_shaders.h"
 #include "cikd.h"
 #include "clearstate_ci.h"
+#include "r600.h"
 #include "radeon.h"
 #include "radeon_asic.h"
 #include "radeon_audio.h"
@@ -125,8 +126,6 @@ MODULE_FIRMWARE("radeon/mullins_mec.bin");
 MODULE_FIRMWARE("radeon/mullins_rlc.bin");
 MODULE_FIRMWARE("radeon/mullins_sdma.bin");
 
-extern int r600_ih_ring_alloc(struct radeon_device *rdev);
-extern void r600_ih_ring_fini(struct radeon_device *rdev);
 extern void si_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc 
*mc);
 extern void si_rlc_reset(struct radeon_device *rdev);
 extern void si_init_uvd_internal_cg(struct radeon_device *rdev);
diff --git a/drivers/gpu/drm/radeon/r600.h b/drivers/gpu/drm/radeon/r600.h
index 2a3915f0039e4..e66ef58706cd8 100644
--- a/drivers/gpu/drm/radeon/r600.h
+++ b/drivers/gpu/drm/radeon/r600.h
@@ -31,5 +31,7 @@
 struct radeon_device;
 
 u32 r600_gpu_check_soft_reset(struct radeon_device *rdev);
+int r600_ih_ring_alloc(struct radeon_device *rdev);
+void r600_ih_ring_fini(struct radeon_device *rdev);
 
 #endif /* __R600_H__ */
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index 45076c27d7ded..d0407145c07b5 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -33,6 +33,7 @@
 #include "atom.h"
 #include "clearstate_si.h"
 #include "evergreen.h"
+#include "r600.h"
 #include "radeon.h"
 #include "radeon_asic.h"
 #include "radeon_audio.h"
@@ -128,8 +129,6 @@ static void si_pcie_gen3_enable(struct radeon_device *rdev);
 static void si_program_aspm(struct radeon_device *rdev);
 extern void sumo_rlc_fini(struct radeon_device *rdev);
 extern int sumo_rlc_init(struct radeon_device *rdev);
-extern int r600_ih_ring_alloc(struct radeon_device *rdev);
-extern void r600_ih_ring_fini(struct radeon_device *rdev);
 static void si_enable_gui_idle_interrupt(struct radeon_device *rdev,
 bool enable);
 static void si_init_pg(struct radeon_device *rdev);
-- 
2.25.1

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


[PATCH 11/43] drm/radeon/radeon_audio: Move 'dce3_2_*' prototypes to shared location

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/dce3_1_afmt.c:30:6: warning: no previous prototype for 
‘dce3_2_afmt_hdmi_write_speaker_allocation’ [-Wmissing-prototypes]
 30 | void dce3_2_afmt_hdmi_write_speaker_allocation(struct drm_encoder 
*encoder,
 | ^
 drivers/gpu/drm/radeon/dce3_1_afmt.c:48:6: warning: no previous prototype for 
‘dce3_2_afmt_dp_write_speaker_allocation’ [-Wmissing-prototypes]
 48 | void dce3_2_afmt_dp_write_speaker_allocation(struct drm_encoder *encoder,
 | ^~~
 drivers/gpu/drm/radeon/dce3_1_afmt.c:66:6: warning: no previous prototype for 
‘dce3_2_afmt_write_sad_regs’ [-Wmissing-prototypes]
 66 | void dce3_2_afmt_write_sad_regs(struct drm_encoder *encoder,
 | ^~
 drivers/gpu/drm/radeon/dce3_1_afmt.c:116:6: warning: no previous prototype for 
‘dce3_2_audio_set_dto’ [-Wmissing-prototypes]
 116 | void dce3_2_audio_set_dto(struct radeon_device *rdev,
 | ^~~~
 drivers/gpu/drm/radeon/dce3_1_afmt.c:170:6: warning: no previous prototype for 
‘dce3_2_hdmi_update_acr’ [-Wmissing-prototypes]
 170 | void dce3_2_hdmi_update_acr(struct drm_encoder *encoder, long offset,
 | ^~
 drivers/gpu/drm/radeon/dce3_1_afmt.c:202:6: warning: no previous prototype for 
‘dce3_2_set_audio_packet’ [-Wmissing-prototypes]
 202 | void dce3_2_set_audio_packet(struct drm_encoder *encoder, u32 offset)
 | ^~~
 drivers/gpu/drm/radeon/dce3_1_afmt.c:223:6: warning: no previous prototype for 
‘dce3_2_set_mute’ [-Wmissing-prototypes]
 223 | void dce3_2_set_mute(struct drm_encoder *encoder, u32 offset, bool mute)
 | ^~~

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Slava Grigorev 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/radeon_audio.c | 12 
 drivers/gpu/drm/radeon/radeon_audio.h | 12 
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_audio.c 
b/drivers/gpu/drm/radeon/radeon_audio.c
index 8c63ccb8b6235..f6c783e19c988 100644
--- a/drivers/gpu/drm/radeon/radeon_audio.c
+++ b/drivers/gpu/drm/radeon/radeon_audio.c
@@ -38,16 +38,10 @@ void dce6_audio_enable(struct radeon_device *rdev, struct 
r600_audio_pin *pin,
 u32 dce6_endpoint_rreg(struct radeon_device *rdev, u32 offset, u32 reg);
 void dce6_endpoint_wreg(struct radeon_device *rdev,
u32 offset, u32 reg, u32 v);
-void dce3_2_afmt_write_sad_regs(struct drm_encoder *encoder,
-   struct cea_sad *sads, int sad_count);
 void evergreen_hdmi_write_sad_regs(struct drm_encoder *encoder,
struct cea_sad *sads, int sad_count);
 void dce6_afmt_write_sad_regs(struct drm_encoder *encoder,
struct cea_sad *sads, int sad_count);
-void dce3_2_afmt_hdmi_write_speaker_allocation(struct drm_encoder *encoder,
-   u8 *sadb, int sad_count);
-void dce3_2_afmt_dp_write_speaker_allocation(struct drm_encoder *encoder,
-   u8 *sadb, int sad_count);
 void dce4_afmt_hdmi_write_speaker_allocation(struct drm_encoder *encoder,
u8 *sadb, int sad_count);
 void dce4_afmt_dp_write_speaker_allocation(struct drm_encoder *encoder,
@@ -65,8 +59,6 @@ struct r600_audio_pin* dce6_audio_get_pin(struct 
radeon_device *rdev);
 void dce6_afmt_select_pin(struct drm_encoder *encoder);
 void r600_hdmi_audio_set_dto(struct radeon_device *rdev,
struct radeon_crtc *crtc, unsigned int clock);
-void dce3_2_audio_set_dto(struct radeon_device *rdev,
-   struct radeon_crtc *crtc, unsigned int clock);
 void dce4_hdmi_audio_set_dto(struct radeon_device *rdev,
struct radeon_crtc *crtc, unsigned int clock);
 void dce4_dp_audio_set_dto(struct radeon_device *rdev,
@@ -81,8 +73,6 @@ void evergreen_set_avi_packet(struct radeon_device *rdev, u32 
offset,
unsigned char *buffer, size_t size);
 void r600_hdmi_update_acr(struct drm_encoder *encoder, long offset,
const struct radeon_hdmi_acr *acr);
-void dce3_2_hdmi_update_acr(struct drm_encoder *encoder, long offset,
-   const struct radeon_hdmi_acr *acr);
 void evergreen_hdmi_update_acr(struct drm_encoder *encoder, long offset,
const struct radeon_hdmi_acr *acr);
 void r600_set_vbi_packet(struct drm_encoder *encoder, u32 offset);
@@ -90,10 +80,8 @@ void dce4_set_vbi_packet(struct drm_encoder *encoder, u32 
offset);
 void dce4_hdmi_set_color_depth(struct drm_encoder *encoder,
u32 offset, int bpc);
 void r600_set_audio_packet(struct drm_encoder *encoder, u32 offset);
-void dce3_2_set_audio_packet(struct drm_encoder *encoder, u32 offset);
 void dce4_set_audio_packet(struct drm_encoder *encoder, u32 offset);
 void r600_set_mute(struct drm_encoder *encoder, u32 offset, bool mute);
-void dce3_2_set_mute(struct drm_encoder *encoder, u32 offset, bool mute);
 void 

[PATCH 01/43] drm/radeon/atombios_encoders: Move 'radeon_atom_get_tv_timings()'s prototype into shared location

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_atombios.c:1791:6: warning: no previous 
prototype for ‘radeon_atom_get_tv_timings’ [-Wmissing-prototypes]
 1791 | bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index,
 | ^~

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/atombios_encoders.c |  5 +--
 drivers/gpu/drm/radeon/radeon_atombios.c   |  1 +
 drivers/gpu/drm/radeon/radeon_atombios.h   | 37 ++
 3 files changed, 39 insertions(+), 4 deletions(-)
 create mode 100644 drivers/gpu/drm/radeon/radeon_atombios.h

diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c 
b/drivers/gpu/drm/radeon/atombios_encoders.c
index cc5ee1b3af84f..683de198e18d9 100644
--- a/drivers/gpu/drm/radeon/atombios_encoders.c
+++ b/drivers/gpu/drm/radeon/atombios_encoders.c
@@ -33,6 +33,7 @@
 #include 
 
 #include "atom.h"
+#include "radeon_atombios.h"
 #include "radeon.h"
 #include "radeon_asic.h"
 #include "radeon_audio.h"
@@ -296,10 +297,6 @@ static void radeon_atom_backlight_exit(struct 
radeon_encoder *encoder)
 
 #endif
 
-/* evil but including atombios.h is much worse */
-bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index,
-   struct drm_display_mode *mode);
-
 static bool radeon_atom_mode_fixup(struct drm_encoder *encoder,
   const struct drm_display_mode *mode,
   struct drm_display_mode *adjusted_mode)
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c 
b/drivers/gpu/drm/radeon/radeon_atombios.c
index 5d25917251892..71bf2ed172697 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -34,6 +34,7 @@
 #include "atom.h"
 #include "atom-bits.h"
 #include "radeon_asic.h"
+#include "radeon_atombios.h"
 
 extern void
 radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_enum,
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.h 
b/drivers/gpu/drm/radeon/radeon_atombios.h
new file mode 100644
index 0..b7c76920feb7d
--- /dev/null
+++ b/drivers/gpu/drm/radeon/radeon_atombios.h
@@ -0,0 +1,37 @@
+/* radeon_atombios.h -- Private header for radeon driver -*- linux-c -*-
+ *
+ * Copyright 2007-8 Advanced Micro Devices, Inc.
+ * Copyright 2008 Red Hat 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: Dave Airlie
+ *  Alex Deucher
+ */
+
+#ifndef __RADEON_ATOMBIOS_H__
+#define __RADEON_ATOMBIOS_H__
+
+struct drm_display_mode;
+struct radeon_device;
+
+bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index,
+   struct drm_display_mode *mode);
+
+#endif /* __RADEON_ATOMBIOS_H__ */
-- 
2.25.1

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


[PATCH 39/43] drm/radeon/si_dpm: Move 'vce_v1_0_enable_mgcg()'s prototype to shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/vce_v1_0.c:102:6: warning: no previous prototype for 
‘vce_v1_0_enable_mgcg’ [-Wmissing-prototypes]
 102 | void vce_v1_0_enable_mgcg(struct radeon_device *rdev, bool enable)
 | ^~~~

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/si_dpm.c  |  3 +--
 drivers/gpu/drm/radeon/trinity_dpm.c |  2 +-
 drivers/gpu/drm/radeon/vce.h | 34 
 drivers/gpu/drm/radeon/vce_v1_0.c|  1 +
 4 files changed, 37 insertions(+), 3 deletions(-)
 create mode 100644 drivers/gpu/drm/radeon/vce.h

diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c
index b4581392fbce9..cd07b06301b44 100644
--- a/drivers/gpu/drm/radeon/si_dpm.c
+++ b/drivers/gpu/drm/radeon/si_dpm.c
@@ -35,6 +35,7 @@
 #include "si_dpm.h"
 #include "si.h"
 #include "sid.h"
+#include "vce.h"
 
 #define MC_CG_ARB_FREQ_F0   0x0a
 #define MC_CG_ARB_FREQ_F1   0x0b
@@ -1721,8 +1722,6 @@ static const struct si_powertune_data 
powertune_data_hainan =
true
 };
 
-extern void vce_v1_0_enable_mgcg(struct radeon_device *rdev, bool enable);
-
 static int si_populate_voltage_value(struct radeon_device *rdev,
 const struct atom_voltage_table *table,
 u16 value, SISLANDS_SMC_VOLTAGE_VALUE 
*voltage);
diff --git a/drivers/gpu/drm/radeon/trinity_dpm.c 
b/drivers/gpu/drm/radeon/trinity_dpm.c
index e005c18aac00e..08ea1c864cb23 100644
--- a/drivers/gpu/drm/radeon/trinity_dpm.c
+++ b/drivers/gpu/drm/radeon/trinity_dpm.c
@@ -29,6 +29,7 @@
 #include "radeon_asic.h"
 #include "trinity_dpm.h"
 #include "trinityd.h"
+#include "vce.h"
 
 #define TRINITY_MAX_DEEPSLEEP_DIVIDER_ID 5
 #define TRINITY_MINIMUM_ENGINE_CLOCK 800
@@ -293,7 +294,6 @@ static const u32 trinity_override_mgpg_sequences[] =
0x0204, 0x,
 };
 
-extern void vce_v1_0_enable_mgcg(struct radeon_device *rdev, bool enable);
 static void trinity_program_clk_gating_hw_sequence(struct radeon_device *rdev,
   const u32 *seq, u32 count);
 static void trinity_override_dynamic_mg_powergating(struct radeon_device 
*rdev);
diff --git a/drivers/gpu/drm/radeon/vce.h b/drivers/gpu/drm/radeon/vce.h
new file mode 100644
index 0..1eb4f5715202e
--- /dev/null
+++ b/drivers/gpu/drm/radeon/vce.h
@@ -0,0 +1,34 @@
+/* vce.h -- Private header for radeon driver -*- linux-c -*-
+ *
+ * Copyright 2013 Advanced Micro Devices, Inc.
+ * All Rights Reserved.
+ *
+ * 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 rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ */
+
+#ifndef __VCE_H__
+#define __VCE_H__
+
+struct radeon_device;
+
+void vce_v1_0_enable_mgcg(struct radeon_device *rdev, bool enable);
+
+#endif /* __VCE_H__ */
diff --git a/drivers/gpu/drm/radeon/vce_v1_0.c 
b/drivers/gpu/drm/radeon/vce_v1_0.c
index bd75bbcf5bf63..70c5da2141d75 100644
--- a/drivers/gpu/drm/radeon/vce_v1_0.c
+++ b/drivers/gpu/drm/radeon/vce_v1_0.c
@@ -30,6 +30,7 @@
 #include "radeon.h"
 #include "radeon_asic.h"
 #include "sid.h"
+#include "vce.h"
 
 #define VCE_V1_0_FW_SIZE   (256 * 1024)
 #define VCE_V1_0_STACK_SIZE(64 * 1024)
-- 
2.25.1

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


[PATCH 17/43] drm/radeon/evergreen_hdmi: Move 'evergreen_*()' and 'dce4_*()' HDMI prototypes to shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/evergreen_hdmi.c:37:6: warning: no previous prototype 
for ‘dce4_audio_enable’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/evergreen_hdmi.c:67:6: warning: no previous prototype 
for ‘evergreen_hdmi_update_acr’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/evergreen_hdmi.c:97:6: warning: no previous prototype 
for ‘dce4_afmt_write_latency_fields’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/evergreen_hdmi.c:119:6: warning: no previous prototype 
for ‘dce4_afmt_hdmi_write_speaker_allocation’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/evergreen_hdmi.c:137:6: warning: no previous prototype 
for ‘dce4_afmt_dp_write_speaker_allocation’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/evergreen_hdmi.c:155:6: warning: no previous prototype 
for ‘evergreen_hdmi_write_sad_regs’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/evergreen_hdmi.c:208:6: warning: no previous prototype 
for ‘evergreen_set_avi_packet’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/evergreen_hdmi.c:227:6: warning: no previous prototype 
for ‘dce4_hdmi_audio_set_dto’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/evergreen_hdmi.c:270:6: warning: no previous prototype 
for ‘dce4_dp_audio_set_dto’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/evergreen_hdmi.c:306:6: warning: no previous prototype 
for ‘dce4_set_vbi_packet’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/evergreen_hdmi.c:317:6: warning: no previous prototype 
for ‘dce4_hdmi_set_color_depth’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/evergreen_hdmi.c:354:6: warning: no previous prototype 
for ‘dce4_set_audio_packet’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/evergreen_hdmi.c:389:6: warning: no previous prototype 
for ‘dce4_set_mute’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/evergreen_hdmi.c:400:6: warning: no previous prototype 
for ‘evergreen_hdmi_enable’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/evergreen_hdmi.c:440:6: warning: no previous prototype 
for ‘evergreen_dp_enable’ [-Wmissing-prototypes]

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/evergreen_hdmi.c |  1 +
 drivers/gpu/drm/radeon/evergreen_hdmi.h | 69 +
 drivers/gpu/drm/radeon/radeon_audio.c   | 26 +-
 3 files changed, 71 insertions(+), 25 deletions(-)
 create mode 100644 drivers/gpu/drm/radeon/evergreen_hdmi.h

diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c 
b/drivers/gpu/drm/radeon/evergreen_hdmi.c
index 739336a48d085..5f3078f8ab950 100644
--- a/drivers/gpu/drm/radeon/evergreen_hdmi.c
+++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c
@@ -27,6 +27,7 @@
 #include 
 
 #include 
+#include "evergreen_hdmi.h"
 #include "radeon.h"
 #include "radeon_asic.h"
 #include "radeon_audio.h"
diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.h 
b/drivers/gpu/drm/radeon/evergreen_hdmi.h
new file mode 100644
index 0..c86276b8d7f58
--- /dev/null
+++ b/drivers/gpu/drm/radeon/evergreen_hdmi.h
@@ -0,0 +1,69 @@
+/* evergreen_hdmi.h -- Private header for radeon driver -*- linux-c -*-
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
+ * All rights reserved.
+ *
+ * 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef __EVERGREEN_HDMI_H__
+#define __EVERGREEN_HDMI_H__
+
+struct cea_sa;
+struct cea_sad;
+struct drm_connector;
+struct drm_display_mode;
+struct drm_encoder;
+struct r600_audio_pin;
+struct radeon_crtc;
+struct radeon_device;
+struct radeon_hdmi_acr;
+
+void evergreen_hdmi_write_sad_regs(struct drm_encoder *encoder,
+  struct cea_sad *sads, int sad_count);
+void evergreen_set_avi_packet(struct radeon_device *rdev, u32 offset,
+ 

[PATCH 07/43] drm/radeon/radeon_legacy_encoders: Move 'radeon_add_legacy_encoder's prototype to shared location

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_legacy_encoders.c:1746:1: warning: no previous 
prototype for ‘radeon_add_legacy_encoder’ [-Wmissing-prototypes]
 1746 | radeon_add_legacy_encoder(struct drm_device *dev, uint32_t 
encoder_enum, uint32_t supported_device)
 | ^

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Sumit Semwal 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Cc: linux-me...@vger.kernel.org
Cc: linaro-mm-...@lists.linaro.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/radeon_atombios.c| 6 +-
 drivers/gpu/drm/radeon/radeon_combios.c | 6 +-
 drivers/gpu/drm/radeon/radeon_legacy_encoders.h | 2 ++
 3 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c 
b/drivers/gpu/drm/radeon/radeon_atombios.c
index 71bf2ed172697..cc80651b25773 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -35,16 +35,12 @@
 #include "atom-bits.h"
 #include "radeon_asic.h"
 #include "radeon_atombios.h"
+#include "radeon_legacy_encoders.h"
 
 extern void
 radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_enum,
uint32_t supported_device, u16 caps);
 
-/* from radeon_legacy_encoder.c */
-extern void
-radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_enum,
- uint32_t supported_device);
-
 union atom_supported_devices {
struct _ATOM_SUPPORTED_DEVICES_INFO info;
struct _ATOM_SUPPORTED_DEVICES_INFO_2 info_2;
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c 
b/drivers/gpu/drm/radeon/radeon_combios.c
index d3c04df7e75d7..ff2135059c071 100644
--- a/drivers/gpu/drm/radeon/radeon_combios.c
+++ b/drivers/gpu/drm/radeon/radeon_combios.c
@@ -31,6 +31,7 @@
 #include 
 
 #include "radeon.h"
+#include "radeon_legacy_encoders.h"
 #include "atom.h"
 
 #ifdef CONFIG_PPC_PMAC
@@ -40,11 +41,6 @@
 #include 
 #endif /* CONFIG_PPC_PMAC */
 
-/* from radeon_legacy_encoder.c */
-extern void
-radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_enum,
- uint32_t supported_device);
-
 /* old legacy ATI BIOS routines */
 
 /* COMBIOS table offsets */
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.h 
b/drivers/gpu/drm/radeon/radeon_legacy_encoders.h
index a80b387559d4d..f4c7432267e67 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.h
+++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.h
@@ -30,5 +30,7 @@
 
 void radeon_legacy_backlight_init(struct radeon_encoder *radeon_encoder,
  struct drm_connector *drm_connector);
+void radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_enum,
+  uint32_t supported_device);
 
 #endif /* __RADEON_LEGACY_ENCODERS_H__ */
-- 
2.25.1

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


[PATCH 09/43] drm/radeon/rv770: Move 'rv770_set_clk_bypass_mode' prototype to shared location

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/rv770.c:1138:6: warning: no previous prototype for 
‘rv770_set_clk_bypass_mode’ [-Wmissing-prototypes]
 1138 | void rv770_set_clk_bypass_mode(struct radeon_device *rdev)
 | ^

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/evergreen.c |  2 +-
 drivers/gpu/drm/radeon/r600.c  |  2 +-
 drivers/gpu/drm/radeon/rv770.c |  1 +
 drivers/gpu/drm/radeon/rv770.h | 35 ++
 4 files changed, 38 insertions(+), 2 deletions(-)
 create mode 100644 drivers/gpu/drm/radeon/rv770.h

diff --git a/drivers/gpu/drm/radeon/evergreen.c 
b/drivers/gpu/drm/radeon/evergreen.c
index 1f2acca437abd..9a1e240b07234 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -31,6 +31,7 @@
 
 #include "atom.h"
 #include "avivod.h"
+#include "rv770.h"
 #include "evergreen_blit_shaders.h"
 #include "evergreen_reg.h"
 #include "evergreend.h"
@@ -223,7 +224,6 @@ extern u32 si_get_csb_size(struct radeon_device *rdev);
 extern void si_get_csb_buffer(struct radeon_device *rdev, volatile u32 
*buffer);
 extern u32 cik_get_csb_size(struct radeon_device *rdev);
 extern void cik_get_csb_buffer(struct radeon_device *rdev, volatile u32 
*buffer);
-extern void rv770_set_clk_bypass_mode(struct radeon_device *rdev);
 
 static const u32 evergreen_golden_registers[] =
 {
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index 12a918335ac7b..f09b6dc5cbeb3 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -40,6 +40,7 @@
 #include "atom.h"
 #include "avivod.h"
 #include "r600d.h"
+#include "rv770.h"
 #include "radeon.h"
 #include "radeon_asic.h"
 #include "radeon_audio.h"
@@ -112,7 +113,6 @@ void r600_fini(struct radeon_device *rdev);
 void r600_irq_disable(struct radeon_device *rdev);
 static void r600_pcie_gen2_enable(struct radeon_device *rdev);
 extern int evergreen_rlc_resume(struct radeon_device *rdev);
-extern void rv770_set_clk_bypass_mode(struct radeon_device *rdev);
 
 /*
  * Indirect registers accessor
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
index 21f653ae1e1bb..88e29ebaad467 100644
--- a/drivers/gpu/drm/radeon/rv770.c
+++ b/drivers/gpu/drm/radeon/rv770.c
@@ -39,6 +39,7 @@
 #include "radeon_asic.h"
 #include "radeon_audio.h"
 #include "rv770d.h"
+#include "rv770.h"
 
 #define R700_PFP_UCODE_SIZE 848
 #define R700_PM4_UCODE_SIZE 1360
diff --git a/drivers/gpu/drm/radeon/rv770.h b/drivers/gpu/drm/radeon/rv770.h
new file mode 100644
index 0..a3f2bb44979fe
--- /dev/null
+++ b/drivers/gpu/drm/radeon/rv770.h
@@ -0,0 +1,35 @@
+/* radeon_rv770.h -- Private header for radeon driver -*- linux-c -*-
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
+ * All rights reserved.
+ *
+ * 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef __RADEON_RV770_H__
+#define __RADEON_RV770_H__
+
+struct radeon_device;
+
+void rv770_set_clk_bypass_mode(struct radeon_device *rdev);
+
+#endif /* __RADEON_RV770_H__ */
-- 
2.25.1

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


[PATCH 33/43] drm/radeon/radeon_audio: Move 'dce6_*()'s prototypes to shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/dce6_afmt.c:32:5: warning: no previous prototype for 
‘dce6_endpoint_rreg’ [-Wmissing-prototypes]
 32 | u32 dce6_endpoint_rreg(struct radeon_device *rdev,
 | ^~
 drivers/gpu/drm/radeon/dce6_afmt.c:46:6: warning: no previous prototype for 
‘dce6_endpoint_wreg’ [-Wmissing-prototypes]
 46 | void dce6_endpoint_wreg(struct radeon_device *rdev,
 | ^~
 drivers/gpu/drm/radeon/dce6_afmt.c:110:6: warning: no previous prototype for 
‘dce6_afmt_select_pin’ [-Wmissing-prototypes]
 110 | void dce6_afmt_select_pin(struct drm_encoder *encoder)
 | ^~~~
 drivers/gpu/drm/radeon/dce6_afmt.c:123:6: warning: no previous prototype for 
‘dce6_afmt_write_latency_fields’ [-Wmissing-prototypes]
 123 | void dce6_afmt_write_latency_fields(struct drm_encoder *encoder,
 | ^~
 drivers/gpu/drm/radeon/dce6_afmt.c:152:6: warning: no previous prototype for 
‘dce6_afmt_hdmi_write_speaker_allocation’ [-Wmissing-prototypes]
 152 | void dce6_afmt_hdmi_write_speaker_allocation(struct drm_encoder *encoder,
 | ^~~
 drivers/gpu/drm/radeon/dce6_afmt.c:177:6: warning: no previous prototype for 
‘dce6_afmt_dp_write_speaker_allocation’ [-Wmissing-prototypes]
 177 | void dce6_afmt_dp_write_speaker_allocation(struct drm_encoder *encoder,
 | ^
 drivers/gpu/drm/radeon/dce6_afmt.c:202:6: warning: no previous prototype for 
‘dce6_afmt_write_sad_regs’ [-Wmissing-prototypes]
 202 | void dce6_afmt_write_sad_regs(struct drm_encoder *encoder,
 | ^~~~
 drivers/gpu/drm/radeon/dce6_afmt.c:268:6: warning: no previous prototype for 
‘dce6_hdmi_audio_set_dto’ [-Wmissing-prototypes]
 268 | void dce6_hdmi_audio_set_dto(struct radeon_device *rdev,
 | ^~~
 drivers/gpu/drm/radeon/dce6_afmt.c:287:6: warning: no previous prototype for 
‘dce6_dp_audio_set_dto’ [-Wmissing-prototypes]
 287 | void dce6_dp_audio_set_dto(struct radeo_device *rdev,
 | ^

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Slava Grigorev 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/dce6_afmt.c|  1 +
 drivers/gpu/drm/radeon/dce6_afmt.h| 52 +++
 drivers/gpu/drm/radeon/radeon_audio.c | 17 +
 3 files changed, 54 insertions(+), 16 deletions(-)
 create mode 100644 drivers/gpu/drm/radeon/dce6_afmt.h

diff --git a/drivers/gpu/drm/radeon/dce6_afmt.c 
b/drivers/gpu/drm/radeon/dce6_afmt.c
index eec5d7a627388..4a1d5447eac17 100644
--- a/drivers/gpu/drm/radeon/dce6_afmt.c
+++ b/drivers/gpu/drm/radeon/dce6_afmt.c
@@ -22,6 +22,7 @@
  */
 #include 
 
+#include "dce6_afmt.h"
 #include "radeon.h"
 #include "radeon_audio.h"
 #include "sid.h"
diff --git a/drivers/gpu/drm/radeon/dce6_afmt.h 
b/drivers/gpu/drm/radeon/dce6_afmt.h
new file mode 100644
index 0..176a538664a27
--- /dev/null
+++ b/drivers/gpu/drm/radeon/dce6_afmt.h
@@ -0,0 +1,52 @@
+/* dce6_afmt.h -- Private header for radeon driver -*- linux-c -*-
+ *
+ * Copyright 2013 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef __DCE6_AFMT_H__
+#define __DCE6_AFMT_H__
+
+struct cea_sad;
+struct drm_connector;
+struct drm_display_mode;
+struct drm_encoder;
+struct radeon_crtc;
+struct radeon_device;
+
+u32 dce6_endpoint_rreg(struct radeon_device *rdev, u32 offset, u32 reg);
+void dce6_endpoint_wreg(struct radeon_device *rdev, u32 offset, u32 reg, u32 
v);
+void dce6_afmt_write_sad_regs(struct drm_encoder *encoder,
+ struct cea_sad *sads, int sad_count);
+void dce6_afmt_hdmi_write_speaker_allocation(struct drm_encoder *encoder,
+u8 *sadb, int sad_count);
+void 

[PATCH 25/43] drm/radeon/ni_dma: Move 'cayman_gpu_check_soft_reset()'s prototype to shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/ni.c:1733:5: warning: no previous prototype for 
‘cayman_gpu_check_soft_reset’ [-Wmissing-prototypes]
 1733 | u32 cayman_gpu_check_soft_reset(struct radeon_device *rdev)
 | ^~~

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/ni.h | 1 +
 drivers/gpu/drm/radeon/ni_dma.c | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/ni.h b/drivers/gpu/drm/radeon/ni.h
index d63be1c88c0f1..9a5f31a05e68f 100644
--- a/drivers/gpu/drm/radeon/ni.h
+++ b/drivers/gpu/drm/radeon/ni.h
@@ -34,5 +34,6 @@ void cayman_cp_int_cntl_setup(struct radeon_device *rdev,
  int ring, u32 cp_int_cntl);
 void cayman_vm_decode_fault(struct radeon_device *rdev,
u32 status, u32 addr);
+u32 cayman_gpu_check_soft_reset(struct radeon_device *rdev);
 
 #endif /* __NI_H__ */
diff --git a/drivers/gpu/drm/radeon/ni_dma.c b/drivers/gpu/drm/radeon/ni_dma.c
index c56136848360e..bd515ad4fe4cc 100644
--- a/drivers/gpu/drm/radeon/ni_dma.c
+++ b/drivers/gpu/drm/radeon/ni_dma.c
@@ -25,10 +25,9 @@
 #include "radeon.h"
 #include "radeon_asic.h"
 #include "radeon_trace.h"
+#include "ni.h"
 #include "nid.h"
 
-u32 cayman_gpu_check_soft_reset(struct radeon_device *rdev);
-
 /*
  * DMA
  * Starting with R600, the GPU has an asynchronous
-- 
2.25.1

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


[PATCH 02/43] drm/radeon/radeon: Move prototype into shared header

2020-11-16 Thread Lee Jones
Unfortunately, a suitable one didn't already exist.

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_device.c:637:6: warning: no previous prototype 
for ‘radeon_device_is_virtual’ [-Wmissing-prototypes]
 637 | bool radeon_device_is_virtual(void)
 | ^~~~

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Sumit Semwal 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Cc: linux-me...@vger.kernel.org
Cc: linaro-mm-...@lists.linaro.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/radeon_device.c |  1 +
 drivers/gpu/drm/radeon/radeon_device.h | 32 ++
 drivers/gpu/drm/radeon/radeon_drv.c|  3 +--
 3 files changed, 34 insertions(+), 2 deletions(-)
 create mode 100644 drivers/gpu/drm/radeon/radeon_device.h

diff --git a/drivers/gpu/drm/radeon/radeon_device.c 
b/drivers/gpu/drm/radeon/radeon_device.c
index 7f384ffe848a7..ad572f965190b 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -42,6 +42,7 @@
 #include 
 #include 
 
+#include "radeon_device.h"
 #include "radeon_reg.h"
 #include "radeon.h"
 #include "atom.h"
diff --git a/drivers/gpu/drm/radeon/radeon_device.h 
b/drivers/gpu/drm/radeon/radeon_device.h
new file mode 100644
index 0..3112b99ae36f1
--- /dev/null
+++ b/drivers/gpu/drm/radeon/radeon_device.h
@@ -0,0 +1,32 @@
+/* radeon_device.h -- Private header for radeon device -*- linux-c -*-
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
+ * All rights reserved.
+ *
+ * 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef __RADEON_DEVICE_H__
+#define __RADEON_DEVICE_H__
+
+bool radeon_device_is_virtual(void);
+
+#endif /* __RADEON_DEVICE_H__ */
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c 
b/drivers/gpu/drm/radeon/radeon_drv.c
index f813eb5e140dd..536b246b9a6aa 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -52,6 +52,7 @@
 
 #include "radeon_drv.h"
 #include "radeon.h"
+#include "radeon_device.h"
 
 /*
  * KMS wrapper.
@@ -293,8 +294,6 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
 
 static const struct drm_driver kms_driver;
 
-bool radeon_device_is_virtual(void);
-
 static int radeon_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
 {
-- 
2.25.1

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


[PATCH 31/43] drm/radeon/cik: Move 'si_*()'s prototypes to shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/si.c:4186:6: warning: no previous prototype for 
‘si_vram_gtt_location’ [-Wmissing-prototypes]
 4186 | void si_vram_gtt_location(struct radeon_device *rdev,
 | ^~~~
 drivers/gpu/drm/radeon/si.c:5186:6: warning: no previous prototype for 
‘si_init_uvd_internal_cg’ [-Wmissing-prototypes]
 5186 | void si_init_uvd_internal_cg(struct radeon_device *rdev)
 | ^~~
 drivers/gpu/drm/radeon/si.c:5801:6: warning: no previous prototype for 
‘si_rlc_reset’ [-Wmissing-prototypes]
 5801 | void si_rlc_reset(struct radeon_device *rdev)
 | ^~~~

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Sumit Semwal 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Cc: linux-me...@vger.kernel.org
Cc: linaro-mm-...@lists.linaro.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/cik.c | 4 +---
 drivers/gpu/drm/radeon/si.h  | 4 
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index ae020ad7b3185..cef0f3111cd3a 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -40,6 +40,7 @@
 #include "radeon_asic.h"
 #include "radeon_audio.h"
 #include "radeon_ucode.h"
+#include "si.h"
 
 #define SH_MEM_CONFIG_GFX_DEFAULT \
ALIGNMENT_MODE(SH_MEM_ALIGNMENT_MODE_UNALIGNED)
@@ -127,9 +128,6 @@ MODULE_FIRMWARE("radeon/mullins_mec.bin");
 MODULE_FIRMWARE("radeon/mullins_rlc.bin");
 MODULE_FIRMWARE("radeon/mullins_sdma.bin");
 
-extern void si_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc 
*mc);
-extern void si_rlc_reset(struct radeon_device *rdev);
-extern void si_init_uvd_internal_cg(struct radeon_device *rdev);
 static u32 cik_get_cu_active_bitmap(struct radeon_device *rdev, u32 se, u32 
sh);
 extern int cik_sdma_resume(struct radeon_device *rdev);
 extern void cik_sdma_enable(struct radeon_device *rdev, bool enable);
diff --git a/drivers/gpu/drm/radeon/si.h b/drivers/gpu/drm/radeon/si.h
index a1751ae560f02..f483a64d17050 100644
--- a/drivers/gpu/drm/radeon/si.h
+++ b/drivers/gpu/drm/radeon/si.h
@@ -25,8 +25,12 @@
 #define __SI_H__
 
 struct radeon_device;
+struct radeon_mc;
 
 int si_mc_load_microcode(struct radeon_device *rdev);
 u32 si_gpu_check_soft_reset(struct radeon_device *rdev);
+void si_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc);
+void si_rlc_reset(struct radeon_device *rdev);
+void si_init_uvd_internal_cg(struct radeon_device *rdev);
 
 #endif /* __SI_H__ */
-- 
2.25.1

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


[PATCH 07/43] drm/radeon/radeon_legacy_encoders: Move 'radeon_add_legacy_encoder's prototype to shared location

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_legacy_encoders.c:1746:1: warning: no previous 
prototype for ‘radeon_add_legacy_encoder’ [-Wmissing-prototypes]
 1746 | radeon_add_legacy_encoder(struct drm_device *dev, uint32_t 
encoder_enum, uint32_t supported_device)
 | ^

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Sumit Semwal 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Cc: linux-me...@vger.kernel.org
Cc: linaro-mm-...@lists.linaro.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/radeon_atombios.c| 6 +-
 drivers/gpu/drm/radeon/radeon_combios.c | 6 +-
 drivers/gpu/drm/radeon/radeon_legacy_encoders.h | 2 ++
 3 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c 
b/drivers/gpu/drm/radeon/radeon_atombios.c
index 71bf2ed172697..cc80651b25773 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -35,16 +35,12 @@
 #include "atom-bits.h"
 #include "radeon_asic.h"
 #include "radeon_atombios.h"
+#include "radeon_legacy_encoders.h"
 
 extern void
 radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_enum,
uint32_t supported_device, u16 caps);
 
-/* from radeon_legacy_encoder.c */
-extern void
-radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_enum,
- uint32_t supported_device);
-
 union atom_supported_devices {
struct _ATOM_SUPPORTED_DEVICES_INFO info;
struct _ATOM_SUPPORTED_DEVICES_INFO_2 info_2;
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c 
b/drivers/gpu/drm/radeon/radeon_combios.c
index d3c04df7e75d7..ff2135059c071 100644
--- a/drivers/gpu/drm/radeon/radeon_combios.c
+++ b/drivers/gpu/drm/radeon/radeon_combios.c
@@ -31,6 +31,7 @@
 #include 
 
 #include "radeon.h"
+#include "radeon_legacy_encoders.h"
 #include "atom.h"
 
 #ifdef CONFIG_PPC_PMAC
@@ -40,11 +41,6 @@
 #include 
 #endif /* CONFIG_PPC_PMAC */
 
-/* from radeon_legacy_encoder.c */
-extern void
-radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_enum,
- uint32_t supported_device);
-
 /* old legacy ATI BIOS routines */
 
 /* COMBIOS table offsets */
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.h 
b/drivers/gpu/drm/radeon/radeon_legacy_encoders.h
index a80b387559d4d..f4c7432267e67 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.h
+++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.h
@@ -30,5 +30,7 @@
 
 void radeon_legacy_backlight_init(struct radeon_encoder *radeon_encoder,
  struct drm_connector *drm_connector);
+void radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_enum,
+  uint32_t supported_device);
 
 #endif /* __RADEON_LEGACY_ENCODERS_H__ */
-- 
2.25.1

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


[PATCH 14/43] drm/radeon/radeon_drv: Move 'radeon_driver_irq_handler_kms's prototype into shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_irq_kms.c:53:13: warning: no previous prototype 
for ‘radeon_driver_irq_handler_kms’ [-Wmissing-prototypes]
 53 | irqreturn_t radeon_driver_irq_handler_kms(int irq, void *arg)
 | ^
 drivers/gpu/drm/radeon/radeon_irq_kms.c:120:6: warning: no previous prototype 
for ‘radeon_driver_irq_preinstall_kms’ [-Wmissing-prototypes]
 120 | void radeon_driver_irq_preinstall_kms(struct drm_device *dev)
 | ^~~~
 drivers/gpu/drm/radeon/radeon_irq_kms.c:152:5: warning: no previous prototype 
for ‘radeon_driver_irq_postinstall_kms’ [-Wmissing-prototypes]
 152 | int radeon_driver_irq_postinstall_kms(struct drm_device *dev)
 | ^
 drivers/gpu/drm/radeon/radeon_irq_kms.c:171:6: warning: no previous prototype 
for ‘radeon_driver_irq_uninstall_kms’ [-Wmissing-prototypes]
 171 | void radeon_driver_irq_uninstall_kms(struct drm_device *dev)
 | ^~~

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Gareth Hughes 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/radeon_drv.c | 5 +
 drivers/gpu/drm/radeon/radeon_irq_kms.c | 1 +
 drivers/gpu/drm/radeon/radeon_kms.h | 5 +
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_drv.c 
b/drivers/gpu/drm/radeon/radeon_drv.c
index 2b9deaead99b2..211932d73b191 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -51,6 +51,7 @@
 #include 
 
 #include "radeon_drv.h"
+#include "radeon_kms.h"
 #include "radeon_ttm.h"
 #include "radeon.h"
 #include "radeon_device.h"
@@ -117,10 +118,6 @@
 int radeon_suspend_kms(struct drm_device *dev, bool suspend,
   bool fbcon, bool freeze);
 int radeon_resume_kms(struct drm_device *dev, bool resume, bool fbcon);
-void radeon_driver_irq_preinstall_kms(struct drm_device *dev);
-int radeon_driver_irq_postinstall_kms(struct drm_device *dev);
-void radeon_driver_irq_uninstall_kms(struct drm_device *dev);
-irqreturn_t radeon_driver_irq_handler_kms(int irq, void *arg);
 extern int radeon_get_crtc_scanoutpos(struct drm_device *dev, unsigned int 
crtc,
  unsigned int flags, int *vpos, int *hpos,
  ktime_t *stime, ktime_t *etime,
diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c 
b/drivers/gpu/drm/radeon/radeon_irq_kms.c
index a242b6053d47e..b8b7f627f0a9c 100644
--- a/drivers/gpu/drm/radeon/radeon_irq_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c
@@ -38,6 +38,7 @@
 
 #include "atom.h"
 #include "radeon.h"
+#include "radeon_kms.h"
 #include "radeon_reg.h"
 
 
diff --git a/drivers/gpu/drm/radeon/radeon_kms.h 
b/drivers/gpu/drm/radeon/radeon_kms.h
index 36e73cea92154..913c8239d5d8d 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.h
+++ b/drivers/gpu/drm/radeon/radeon_kms.h
@@ -32,4 +32,9 @@ u32 radeon_get_vblank_counter_kms(struct drm_crtc *crtc);
 int radeon_enable_vblank_kms(struct drm_crtc *crtc);
 void radeon_disable_vblank_kms(struct drm_crtc *crtc);
 
+irqreturn_t radeon_driver_irq_handler_kms(int irq, void *arg);
+void radeon_driver_irq_preinstall_kms(struct drm_device *dev);
+int radeon_driver_irq_postinstall_kms(struct drm_device *dev);
+void radeon_driver_irq_uninstall_kms(struct drm_device *dev);
+
 #endif /* __RADEON_KMS_H__ */
-- 
2.25.1

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


[PATCH 43/43] drm/radeon/radeon_drv: Move 'radeon_gem_prime_import_sg_table()'s prototype to shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_prime.c:43:24: warning: no previous prototype 
for ‘radeon_gem_prime_import_sg_table’ [-Wmissing-prototypes]
 43 | struct drm_gem_object *radeon_gem_prime_import_sg_table(struct drm_device 
*dev,
 | ^~~~

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Gareth Hughes 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/radeon_drv.c   | 4 +---
 drivers/gpu/drm/radeon/radeon_prime.h | 3 +++
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_drv.c 
b/drivers/gpu/drm/radeon/radeon_drv.c
index 211932d73b191..7a0989b397da1 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -55,6 +55,7 @@
 #include "radeon_ttm.h"
 #include "radeon.h"
 #include "radeon_device.h"
+#include "radeon_prime.h"
 
 /*
  * KMS wrapper.
@@ -129,9 +130,6 @@ int radeon_mode_dumb_mmap(struct drm_file *filp,
 int radeon_mode_dumb_create(struct drm_file *file_priv,
struct drm_device *dev,
struct drm_mode_create_dumb *args);
-struct drm_gem_object *radeon_gem_prime_import_sg_table(struct drm_device *dev,
-   struct 
dma_buf_attachment *,
-   struct sg_table *sg);
 
 /* atpx handler */
 #if defined(CONFIG_VGA_SWITCHEROO)
diff --git a/drivers/gpu/drm/radeon/radeon_prime.h 
b/drivers/gpu/drm/radeon/radeon_prime.h
index 11b7f80987834..24ddfd4b48a6d 100644
--- a/drivers/gpu/drm/radeon/radeon_prime.h
+++ b/drivers/gpu/drm/radeon/radeon_prime.h
@@ -35,5 +35,8 @@ int radeon_gem_prime_pin(struct drm_gem_object *obj);
 void radeon_gem_prime_unpin(struct drm_gem_object *obj);
 void *radeon_gem_prime_vmap(struct drm_gem_object *obj);
 void radeon_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr);
+struct drm_gem_object *radeon_gem_prime_import_sg_table(struct drm_device *dev,
+   struct 
dma_buf_attachment *,
+   struct sg_table *sg);
 
 #endif /* __RADEON_PRIME_H__ */
-- 
2.25.1

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


[PATCH 37/43] drm/radeon/ci_dpm: Move 'si_*()'s prototypes to shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/si_dpm.c:3802:4: warning: no previous prototype for 
‘si_get_ddr3_mclk_frequency_ratio’ [-Wmissing-prototypes]
 3802 | u8 si_get_ddr3_mclk_frequency_ratio(u32 memory_clock)
 | ^~~~
 drivers/gpu/drm/radeon/si_dpm.c:3815:4: warning: no previous prototype for 
‘si_get_mclk_frequency_ratio’ [-Wmissing-prototypes]
 3815 | u8 si_get_mclk_frequency_ratio(u32 memory_clock, bool strobe_mode)
 | ^~~
 drivers/gpu/drm/radeon/si_dpm.c:3897:6: warning: no previous prototype for 
‘si_trim_voltage_table_to_fit_state_table’ [-Wmissing-prototypes]
 3897 | void si_trim_voltage_table_to_fit_state_table(struct radeon_device 
*rdev,
 | ^~~~

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/ci_dpm.c | 6 +-
 drivers/gpu/drm/radeon/si_dpm.h | 5 +
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c
index a9fc0a552736c..0dfb0ed9af89d 100644
--- a/drivers/gpu/drm/radeon/ci_dpm.c
+++ b/drivers/gpu/drm/radeon/ci_dpm.c
@@ -33,6 +33,7 @@
 #include "radeon.h"
 #include "radeon_asic.h"
 #include "radeon_ucode.h"
+#include "si_dpm.h"
 
 #define MC_CG_ARB_FREQ_F0   0x0a
 #define MC_CG_ARB_FREQ_F1   0x0b
@@ -153,11 +154,6 @@ static const struct ci_pt_config_reg didt_config_ci[] =
 extern u8 rv770_get_memory_module_index(struct radeon_device *rdev);
 extern int ni_copy_and_switch_arb_sets(struct radeon_device *rdev,
   u32 arb_freq_src, u32 arb_freq_dest);
-extern u8 si_get_ddr3_mclk_frequency_ratio(u32 memory_clock);
-extern u8 si_get_mclk_frequency_ratio(u32 memory_clock, bool strobe_mode);
-extern void si_trim_voltage_table_to_fit_state_table(struct radeon_device 
*rdev,
-u32 max_voltage_steps,
-struct atom_voltage_table 
*voltage_table);
 static int ci_get_std_voltage_value_sidd(struct radeon_device *rdev,
 struct atom_voltage_table_entry 
*voltage_table,
 u16 *std_voltage_hi_sidd, u16 
*std_voltage_lo_sidd);
diff --git a/drivers/gpu/drm/radeon/si_dpm.h b/drivers/gpu/drm/radeon/si_dpm.h
index 1032a68be792b..aa857906ef93d 100644
--- a/drivers/gpu/drm/radeon/si_dpm.h
+++ b/drivers/gpu/drm/radeon/si_dpm.h
@@ -234,5 +234,10 @@ struct si_power_info {
 #define SISLANDS_CGULVPARAMETER_DFLT0x00040035
 #define SISLANDS_CGULVCONTROL_DFLT  0x1f007550
 
+u8 si_get_ddr3_mclk_frequency_ratio(u32 memory_clock);
+u8 si_get_mclk_frequency_ratio(u32 memory_clock, bool strobe_mode);
+void si_trim_voltage_table_to_fit_state_table(struct radeon_device *rdev,
+ u32 max_voltage_steps,
+ struct atom_voltage_table 
*voltage_table);
 
 #endif
-- 
2.25.1

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


[PATCH 29/43] drm/radeon/si_dpm: Move 'si_mc_load_microcode()'s prototype to shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/si.c:1570:5: warning: no previous prototype for 
‘si_mc_load_microcode’ [-Wmissing-prototypes]

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/si.c |  1 +
 drivers/gpu/drm/radeon/si.h | 31 +++
 drivers/gpu/drm/radeon/si_dpm.c |  2 +-
 3 files changed, 33 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/radeon/si.h

diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index d0407145c07b5..88731b79c8f57 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -39,6 +39,7 @@
 #include "radeon_audio.h"
 #include "radeon_ucode.h"
 #include "si_blit_shaders.h"
+#include "si.h"
 #include "sid.h"
 
 
diff --git a/drivers/gpu/drm/radeon/si.h b/drivers/gpu/drm/radeon/si.h
new file mode 100644
index 0..0a5018ef166e2
--- /dev/null
+++ b/drivers/gpu/drm/radeon/si.h
@@ -0,0 +1,31 @@
+/* si.h -- Private header for radeon driver -*- linux-c -*-
+ *
+ * Copyright 2011 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef __SI_H__
+#define __SI_H__
+
+struct radeon_device;
+
+int si_mc_load_microcode(struct radeon_device *rdev);
+
+#endif /* __SI_H__ */
diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c
index c68ab2fb1ac23..32b697965c064 100644
--- a/drivers/gpu/drm/radeon/si_dpm.c
+++ b/drivers/gpu/drm/radeon/si_dpm.c
@@ -32,6 +32,7 @@
 #include "radeon_asic.h"
 #include "ni_dpm.h"
 #include "si_dpm.h"
+#include "si.h"
 #include "sid.h"
 
 #define MC_CG_ARB_FREQ_F0   0x0a
@@ -1721,7 +1722,6 @@ static const struct si_powertune_data 
powertune_data_hainan =
 
 struct evergreen_power_info *evergreen_get_pi(struct radeon_device *rdev);
 
-extern int si_mc_load_microcode(struct radeon_device *rdev);
 extern void vce_v1_0_enable_mgcg(struct radeon_device *rdev, bool enable);
 
 static int si_populate_voltage_value(struct radeon_device *rdev,
-- 
2.25.1

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


[PATCH 36/43] drm/radeon/evergreen: Move 'cik_*()'s prototypes to shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/cik.c:6413:6: warning: no previous prototype for 
‘cik_init_cp_pg_table’ [-Wmissing-prototypes]
 6413 | void cik_init_cp_pg_table(struct radeon_device *rdev)
 | ^~~~
 drivers/gpu/drm/radeon/cik.c:6670:5: warning: no previous prototype for 
‘cik_get_csb_size’ [-Wmissing-prototypes]
 6670 | u32 cik_get_csb_size(struct radeon_device *rdev)
 | ^~~~
 drivers/gpu/drm/radeon/cik.c:6702:6: warning: no previous prototype for 
‘cik_get_csb_buffer’ [-Wmissing-prototypes]
 6702 | void cik_get_csb_buffer(struct radeon_device *rdev, volatile u32 
*buffer)
 | ^~

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/cik.h   | 3 +++
 drivers/gpu/drm/radeon/evergreen.c | 5 +
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/radeon/cik.h b/drivers/gpu/drm/radeon/cik.h
index 6630b9da9e7aa..420207d19de52 100644
--- a/drivers/gpu/drm/radeon/cik.h
+++ b/drivers/gpu/drm/radeon/cik.h
@@ -30,5 +30,8 @@ void cik_exit_rlc_safe_mode(struct radeon_device *rdev);
 int ci_mc_load_microcode(struct radeon_device *rdev);
 void cik_update_cg(struct radeon_device *rdev, u32 block, bool enable);
 u32 cik_gpu_check_soft_reset(struct radeon_device *rdev);
+void cik_init_cp_pg_table(struct radeon_device *rdev);
+u32 cik_get_csb_size(struct radeon_device *rdev);
+void cik_get_csb_buffer(struct radeon_device *rdev, volatile u32 *buffer);
 
 #endif /* __CIK_H__ */
diff --git a/drivers/gpu/drm/radeon/evergreen.c 
b/drivers/gpu/drm/radeon/evergreen.c
index 4575e448e59df..8e9e88bf1f43d 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -31,6 +31,7 @@
 
 #include "atom.h"
 #include "avivod.h"
+#include "cik.h"
 #include "ni.h"
 #include "rv770.h"
 #include "evergreen.h"
@@ -217,10 +218,6 @@ static void evergreen_gpu_init(struct radeon_device *rdev);
 void evergreen_fini(struct radeon_device *rdev);
 void evergreen_pcie_gen2_enable(struct radeon_device *rdev);
 void evergreen_program_aspm(struct radeon_device *rdev);
-void cik_init_cp_pg_table(struct radeon_device *rdev);
-
-extern u32 cik_get_csb_size(struct radeon_device *rdev);
-extern void cik_get_csb_buffer(struct radeon_device *rdev, volatile u32 
*buffer);
 
 static const u32 evergreen_golden_registers[] =
 {
-- 
2.25.1

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


[PATCH 18/43] drm/radeon/rv770: Move 'rv770_get_*()'s prototypes to shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/rv770_dpm.c:47:18: warning: no previous prototype for 
‘rv770_get_ps’ [-Wmissing-prototypes]
 47 | struct rv7xx_ps *rv770_get_ps(struct radeon_ps *rps)
 | ^~~~
 drivers/gpu/drm/radeon/rv770_dpm.c:54:26: warning: no previous prototype for 
‘rv770_get_pi’ [-Wmissing-prototypes]
 54 | struct rv7xx_power_info *rv770_get_pi(struct radeon_device *rdev)
 | ^~~~

Cc: Evan Quan 
Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/btc_dpm.c | 3 +--
 drivers/gpu/drm/radeon/cypress_dpm.c | 3 +--
 drivers/gpu/drm/radeon/ni_dpm.c  | 2 +-
 drivers/gpu/drm/radeon/rv730_dpm.c   | 4 +---
 drivers/gpu/drm/radeon/rv740_dpm.c   | 3 +--
 drivers/gpu/drm/radeon/rv770.h   | 4 
 drivers/gpu/drm/radeon/rv770_dpm.c   | 1 +
 drivers/gpu/drm/radeon/si_dpm.c  | 2 +-
 8 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/radeon/btc_dpm.c b/drivers/gpu/drm/radeon/btc_dpm.c
index d1d8aaf8323c2..018949668536e 100644
--- a/drivers/gpu/drm/radeon/btc_dpm.c
+++ b/drivers/gpu/drm/radeon/btc_dpm.c
@@ -30,6 +30,7 @@
 #include "btcd.h"
 #include "cypress_dpm.h"
 #include "r600_dpm.h"
+#include "rv770.h"
 #include "radeon.h"
 #include "radeon_asic.h"
 
@@ -48,8 +49,6 @@
 #ifndef BTC_MGCG_SEQUENCE
 #define BTC_MGCG_SEQUENCE  300
 
-struct rv7xx_ps *rv770_get_ps(struct radeon_ps *rps);
-struct rv7xx_power_info *rv770_get_pi(struct radeon_device *rdev);
 struct evergreen_power_info *evergreen_get_pi(struct radeon_device *rdev);
 
 extern int ni_mc_load_microcode(struct radeon_device *rdev);
diff --git a/drivers/gpu/drm/radeon/cypress_dpm.c 
b/drivers/gpu/drm/radeon/cypress_dpm.c
index 35b177d777913..6d3690bcca2d2 100644
--- a/drivers/gpu/drm/radeon/cypress_dpm.c
+++ b/drivers/gpu/drm/radeon/cypress_dpm.c
@@ -28,6 +28,7 @@
 #include "cypress_dpm.h"
 #include "evergreend.h"
 #include "r600_dpm.h"
+#include "rv770.h"
 #include "radeon.h"
 #include "radeon_asic.h"
 
@@ -43,8 +44,6 @@
 #define MC_CG_SEQ_YCLK_SUSPEND  0x04
 #define MC_CG_SEQ_YCLK_RESUME   0x0a
 
-struct rv7xx_ps *rv770_get_ps(struct radeon_ps *rps);
-struct rv7xx_power_info *rv770_get_pi(struct radeon_device *rdev);
 struct evergreen_power_info *evergreen_get_pi(struct radeon_device *rdev);
 
 static void cypress_enable_bif_dynamic_pcie_gen2(struct radeon_device *rdev,
diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c
index 59cdadcece159..d39bbd9793cc2 100644
--- a/drivers/gpu/drm/radeon/ni_dpm.c
+++ b/drivers/gpu/drm/radeon/ni_dpm.c
@@ -29,6 +29,7 @@
 #include "ni_dpm.h"
 #include "nid.h"
 #include "r600_dpm.h"
+#include "rv770.h"
 #include "radeon.h"
 #include "radeon_asic.h"
 
@@ -719,7 +720,6 @@ static const u32 cayman_sysls_enable[] =
 };
 #define CAYMAN_SYSLS_ENABLE_LENGTH sizeof(cayman_sysls_enable) / (3 * 
sizeof(u32))
 
-struct rv7xx_power_info *rv770_get_pi(struct radeon_device *rdev);
 struct evergreen_power_info *evergreen_get_pi(struct radeon_device *rdev);
 
 extern int ni_mc_load_microcode(struct radeon_device *rdev);
diff --git a/drivers/gpu/drm/radeon/rv730_dpm.c 
b/drivers/gpu/drm/radeon/rv730_dpm.c
index 84a3d6d724866..a9de5c953396a 100644
--- a/drivers/gpu/drm/radeon/rv730_dpm.c
+++ b/drivers/gpu/drm/radeon/rv730_dpm.c
@@ -25,6 +25,7 @@
 #include "radeon.h"
 #include "rv730d.h"
 #include "r600_dpm.h"
+#include "rv770.h"
 #include "rv770_dpm.h"
 #include "atom.h"
 
@@ -33,9 +34,6 @@
 #define MC_CG_ARB_FREQ_F2   0x0c
 #define MC_CG_ARB_FREQ_F3   0x0d
 
-struct rv7xx_ps *rv770_get_ps(struct radeon_ps *rps);
-struct rv7xx_power_info *rv770_get_pi(struct radeon_device *rdev);
-
 int rv730_populate_sclk_value(struct radeon_device *rdev,
  u32 engine_clock,
  RV770_SMC_SCLK_VALUE *sclk)
diff --git a/drivers/gpu/drm/radeon/rv740_dpm.c 
b/drivers/gpu/drm/radeon/rv740_dpm.c
index 327d65a76e1f4..d57a3e1df8d63 100644
--- a/drivers/gpu/drm/radeon/rv740_dpm.c
+++ b/drivers/gpu/drm/radeon/rv740_dpm.c
@@ -25,11 +25,10 @@
 #include "radeon.h"
 #include "rv740d.h"
 #include "r600_dpm.h"
+#include "rv770.h"
 #include "rv770_dpm.h"
 #include "atom.h"
 
-struct rv7xx_power_info *rv770_get_pi(struct radeon_device *rdev);
-
 u32 rv740_get_decoded_reference_divider(u32 encoded_ref)
 {
u32 ref = 0;
diff --git a/drivers/gpu/drm/radeon/rv770.h b/drivers/gpu/drm/radeon/rv770.h
index a3f2bb44979fe..0e15916d0a948 100644
--- a/drivers/gpu/drm/radeon/rv770.h
+++ b/drivers/gpu/drm/radeon/rv770.h
@@ -29,7 +29,11 @@
 #define __RADEON_RV770_H__
 
 struct radeon_device;
+struct radeon_ps;
 
 void rv770_set_clk_bypass_mode(struct radeon_device *rdev);
 
+struct rv7xx_ps *rv770_get_ps(struct radeon_ps *rps);
+struct rv7xx_power_info *rv770_get_pi(struct radeon_device *rdev);
+
 #endif /* 

[PATCH 02/43] drm/radeon/radeon: Move prototype into shared header

2020-11-16 Thread Lee Jones
Unfortunately, a suitable one didn't already exist.

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_device.c:637:6: warning: no previous prototype 
for ‘radeon_device_is_virtual’ [-Wmissing-prototypes]
 637 | bool radeon_device_is_virtual(void)
 | ^~~~

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Sumit Semwal 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Cc: linux-me...@vger.kernel.org
Cc: linaro-mm-...@lists.linaro.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/radeon_device.c |  1 +
 drivers/gpu/drm/radeon/radeon_device.h | 32 ++
 drivers/gpu/drm/radeon/radeon_drv.c|  3 +--
 3 files changed, 34 insertions(+), 2 deletions(-)
 create mode 100644 drivers/gpu/drm/radeon/radeon_device.h

diff --git a/drivers/gpu/drm/radeon/radeon_device.c 
b/drivers/gpu/drm/radeon/radeon_device.c
index 7f384ffe848a7..ad572f965190b 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -42,6 +42,7 @@
 #include 
 #include 
 
+#include "radeon_device.h"
 #include "radeon_reg.h"
 #include "radeon.h"
 #include "atom.h"
diff --git a/drivers/gpu/drm/radeon/radeon_device.h 
b/drivers/gpu/drm/radeon/radeon_device.h
new file mode 100644
index 0..3112b99ae36f1
--- /dev/null
+++ b/drivers/gpu/drm/radeon/radeon_device.h
@@ -0,0 +1,32 @@
+/* radeon_device.h -- Private header for radeon device -*- linux-c -*-
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
+ * All rights reserved.
+ *
+ * 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef __RADEON_DEVICE_H__
+#define __RADEON_DEVICE_H__
+
+bool radeon_device_is_virtual(void);
+
+#endif /* __RADEON_DEVICE_H__ */
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c 
b/drivers/gpu/drm/radeon/radeon_drv.c
index f813eb5e140dd..536b246b9a6aa 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -52,6 +52,7 @@
 
 #include "radeon_drv.h"
 #include "radeon.h"
+#include "radeon_device.h"
 
 /*
  * KMS wrapper.
@@ -293,8 +294,6 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
 
 static const struct drm_driver kms_driver;
 
-bool radeon_device_is_virtual(void);
-
 static int radeon_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
 {
-- 
2.25.1

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


[PATCH 09/43] drm/radeon/rv770: Move 'rv770_set_clk_bypass_mode' prototype to shared location

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/rv770.c:1138:6: warning: no previous prototype for 
‘rv770_set_clk_bypass_mode’ [-Wmissing-prototypes]
 1138 | void rv770_set_clk_bypass_mode(struct radeon_device *rdev)
 | ^

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/evergreen.c |  2 +-
 drivers/gpu/drm/radeon/r600.c  |  2 +-
 drivers/gpu/drm/radeon/rv770.c |  1 +
 drivers/gpu/drm/radeon/rv770.h | 35 ++
 4 files changed, 38 insertions(+), 2 deletions(-)
 create mode 100644 drivers/gpu/drm/radeon/rv770.h

diff --git a/drivers/gpu/drm/radeon/evergreen.c 
b/drivers/gpu/drm/radeon/evergreen.c
index 1f2acca437abd..9a1e240b07234 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -31,6 +31,7 @@
 
 #include "atom.h"
 #include "avivod.h"
+#include "rv770.h"
 #include "evergreen_blit_shaders.h"
 #include "evergreen_reg.h"
 #include "evergreend.h"
@@ -223,7 +224,6 @@ extern u32 si_get_csb_size(struct radeon_device *rdev);
 extern void si_get_csb_buffer(struct radeon_device *rdev, volatile u32 
*buffer);
 extern u32 cik_get_csb_size(struct radeon_device *rdev);
 extern void cik_get_csb_buffer(struct radeon_device *rdev, volatile u32 
*buffer);
-extern void rv770_set_clk_bypass_mode(struct radeon_device *rdev);
 
 static const u32 evergreen_golden_registers[] =
 {
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index 12a918335ac7b..f09b6dc5cbeb3 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -40,6 +40,7 @@
 #include "atom.h"
 #include "avivod.h"
 #include "r600d.h"
+#include "rv770.h"
 #include "radeon.h"
 #include "radeon_asic.h"
 #include "radeon_audio.h"
@@ -112,7 +113,6 @@ void r600_fini(struct radeon_device *rdev);
 void r600_irq_disable(struct radeon_device *rdev);
 static void r600_pcie_gen2_enable(struct radeon_device *rdev);
 extern int evergreen_rlc_resume(struct radeon_device *rdev);
-extern void rv770_set_clk_bypass_mode(struct radeon_device *rdev);
 
 /*
  * Indirect registers accessor
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
index 21f653ae1e1bb..88e29ebaad467 100644
--- a/drivers/gpu/drm/radeon/rv770.c
+++ b/drivers/gpu/drm/radeon/rv770.c
@@ -39,6 +39,7 @@
 #include "radeon_asic.h"
 #include "radeon_audio.h"
 #include "rv770d.h"
+#include "rv770.h"
 
 #define R700_PFP_UCODE_SIZE 848
 #define R700_PM4_UCODE_SIZE 1360
diff --git a/drivers/gpu/drm/radeon/rv770.h b/drivers/gpu/drm/radeon/rv770.h
new file mode 100644
index 0..a3f2bb44979fe
--- /dev/null
+++ b/drivers/gpu/drm/radeon/rv770.h
@@ -0,0 +1,35 @@
+/* radeon_rv770.h -- Private header for radeon driver -*- linux-c -*-
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
+ * All rights reserved.
+ *
+ * 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef __RADEON_RV770_H__
+#define __RADEON_RV770_H__
+
+struct radeon_device;
+
+void rv770_set_clk_bypass_mode(struct radeon_device *rdev);
+
+#endif /* __RADEON_RV770_H__ */
-- 
2.25.1

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


[PATCH 03/43] drm/radeon/radeon_kms: Move 'radeon_*_kms' prototypes to shared header

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_kms.c:756:5: warning: no previous prototype for 
‘radeon_get_vblank_counter_kms’ [-Wmissing-prototypes]
 756 | u32 radeon_get_vblank_counter_kms(struct drm_crtc *crtc)
 | ^
 drivers/gpu/drm/radeon/radeon_kms.c:826:5: warning: no previous prototype for 
‘radeon_enable_vblank_kms’ [-Wmissing-prototypes]
 826 | int radeon_enable_vblank_kms(struct drm_crtc *crtc)
 | ^~~~
 drivers/gpu/drm/radeon/radeon_kms.c:853:6: warning: no previous prototype for 
‘radeon_disable_vblank_kms’ [-Wmissing-prototypes]
 853 | void radeon_disable_vblank_kms(struct drm_crtc *crtc)
 | ^

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Sumit Semwal 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Cc: linux-me...@vger.kernel.org
Cc: linaro-mm-...@lists.linaro.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/radeon_display.c |  1 +
 drivers/gpu/drm/radeon/radeon_kms.c |  1 +
 drivers/gpu/drm/radeon/radeon_kms.h | 35 +
 3 files changed, 37 insertions(+)
 create mode 100644 drivers/gpu/drm/radeon/radeon_kms.h

diff --git a/drivers/gpu/drm/radeon/radeon_display.c 
b/drivers/gpu/drm/radeon/radeon_display.c
index eb0d4cb95f0a6..3a6fedad002d7 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -44,6 +44,7 @@
 
 #include "atom.h"
 #include "radeon.h"
+#include "radeon_kms.h"
 
 static void avivo_crtc_load_lut(struct drm_crtc *crtc)
 {
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c 
b/drivers/gpu/drm/radeon/radeon_kms.c
index 3d31c04e4b3db..001940bca90a6 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -41,6 +41,7 @@
 #include "radeon.h"
 #include "radeon_asic.h"
 #include "radeon_drv.h"
+#include "radeon_kms.h"
 
 #if defined(CONFIG_VGA_SWITCHEROO)
 bool radeon_has_atpx(void);
diff --git a/drivers/gpu/drm/radeon/radeon_kms.h 
b/drivers/gpu/drm/radeon/radeon_kms.h
new file mode 100644
index 0..36e73cea92154
--- /dev/null
+++ b/drivers/gpu/drm/radeon/radeon_kms.h
@@ -0,0 +1,35 @@
+/* radeon_kms.h -- Private header for radeon driver -*- linux-c -*-
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
+ * All rights reserved.
+ *
+ * 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 rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef __RADEON_KMS_H__
+#define __RADEON_KMS_H__
+
+u32 radeon_get_vblank_counter_kms(struct drm_crtc *crtc);
+int radeon_enable_vblank_kms(struct drm_crtc *crtc);
+void radeon_disable_vblank_kms(struct drm_crtc *crtc);
+
+#endif /* __RADEON_KMS_H__ */
-- 
2.25.1

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


[PATCH 04/43] drm/radeon/radeon_kms: Fix misnaming of 'radeon_info_ioctl's dev param

2020-11-16 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_kms.c:226: warning: Function parameter or member 
'dev' not described in 'radeon_info_ioctl'
 drivers/gpu/drm/radeon/radeon_kms.c:226: warning: Excess function parameter 
'rdev' description in 'radeon_info_ioctl'

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/radeon/radeon_kms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_kms.c 
b/drivers/gpu/drm/radeon/radeon_kms.c
index 001940bca90a6..50cee4880bb46 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -214,7 +214,7 @@ static void radeon_set_filp_rights(struct drm_device *dev,
 /**
  * radeon_info_ioctl - answer a device specific request.
  *
- * @rdev: radeon device pointer
+ * @dev: drm device pointer
  * @data: request object
  * @filp: drm filp
  *
-- 
2.25.1

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


  1   2   >