Re: [PATCH 01/30] drm/radeon/evergreen: Add comment for 'evergreen_page_flip()'s 'async' param

2020-11-10 Thread Lee Jones
On Tue, 10 Nov 2020, Alex Deucher wrote:

> On Tue, Nov 10, 2020 at 2:31 PM Lee Jones  wrote:
> >
> > Fixes the following W=1 kernel build warning(s):
> >
> >  drivers/gpu/drm/radeon/evergreen.c: In function ‘evergreen_gpu_init’:
> >  drivers/gpu/drm/radeon/evergreen.c:1419: warning: Function parameter or 
> > member 'async' not described in 'evergreen_page_flip'
> >
> > 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 fixups.  Thanks!

Superstar!  Thanks Alex.

Once these are all in -next, I'll rebase and fix the stragglers.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 2/3] drm/amdgpu: fix compute queue priority if num_kcq is less than 4

2020-11-10 Thread Felix Kuehling
Am 2020-11-09 um 1:12 p.m. schrieb Nirmoy Das:
> Compute queues are configurable with module param, num_kcq.
> amdgpu_gfx_is_high_priority_compute_queue was setting 1st 4 queues to
> high priority queue leaving a null drm scheduler in
> adev->gpu_sched[hw_ip]["normal_prio"].sched if num_kcq < 5.
>
> This patch tries to fix it by alternating compute queue priority between
> normal and high priority.
>
> Fixes: 33abcb1f5a1719b1c (drm/amdgpu: set compute queue priority at mqd_init)
>
> Signed-off-by: Nirmoy Das 

This patch is

Reviewed-by: Felix Kuehling 


> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 10 +++---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h |  2 +-
>  drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c  |  6 --
>  drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c   |  6 --
>  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c   |  7 +--
>  5 files changed, 21 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> index e584f48f3b54..97a8f786cf85 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> @@ -193,10 +193,14 @@ static bool amdgpu_gfx_is_multipipe_capable(struct 
> amdgpu_device *adev)
>  }
>  
>  bool amdgpu_gfx_is_high_priority_compute_queue(struct amdgpu_device *adev,
> -int queue)
> +int pipe, int queue)
>  {
> - /* Policy: make queue 0 of each pipe as high priority compute queue */
> - return (queue == 0);
> + bool multipipe_policy = amdgpu_gfx_is_multipipe_capable(adev);
> + int cond;
> + /* Policy: alternate between normal and high priority */
> + cond = multipipe_policy ? pipe : queue;
> +
> + return ((cond % 2) != 0);
>  
>  }
>  
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
> index 786eb4aa7314..671d4b37c397 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
> @@ -374,7 +374,7 @@ void amdgpu_queue_mask_bit_to_mec_queue(struct 
> amdgpu_device *adev, int bit,
>  bool amdgpu_gfx_is_mec_queue_enabled(struct amdgpu_device *adev, int mec,
>int pipe, int queue);
>  bool amdgpu_gfx_is_high_priority_compute_queue(struct amdgpu_device *adev,
> -int queue);
> +int pipe, int queue);
>  int amdgpu_gfx_me_queue_to_bit(struct amdgpu_device *adev, int me,
>  int pipe, int queue);
>  void amdgpu_gfx_bit_to_me_queue(struct amdgpu_device *adev, int bit,
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> index 8c3bad3dfc01..da5a139c7022 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> @@ -4472,7 +4472,8 @@ static int gfx_v10_0_compute_ring_init(struct 
> amdgpu_device *adev, int ring_id,
>   irq_type = AMDGPU_CP_IRQ_COMPUTE_MEC1_PIPE0_EOP
>   + ((ring->me - 1) * adev->gfx.mec.num_pipe_per_mec)
>   + ring->pipe;
> - hw_prio = amdgpu_gfx_is_high_priority_compute_queue(adev, ring->queue) ?
> + hw_prio = amdgpu_gfx_is_high_priority_compute_queue(adev, ring->pipe,
> + ring->queue) ?
>   AMDGPU_GFX_PIPE_PRIO_HIGH : AMDGPU_GFX_PIPE_PRIO_NORMAL;
>   /* type-2 packets are deprecated on MEC, use type-3 instead */
>   r = amdgpu_ring_init(adev, ring, 1024,
> @@ -6507,7 +6508,8 @@ static void gfx_v10_0_compute_mqd_set_priority(struct 
> amdgpu_ring *ring, struct
>   struct amdgpu_device *adev = ring->adev;
>  
>   if (ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE) {
> - if (amdgpu_gfx_is_high_priority_compute_queue(adev, 
> ring->queue)) {
> + if (amdgpu_gfx_is_high_priority_compute_queue(adev, ring->pipe,
> +   ring->queue)) {
>   mqd->cp_hqd_pipe_priority = AMDGPU_GFX_PIPE_PRIO_HIGH;
>   mqd->cp_hqd_queue_priority =
>   AMDGPU_GFX_QUEUE_PRIORITY_MAXIMUM;
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> index c3fff49e6514..5e6d15f44560 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> @@ -1923,7 +1923,8 @@ static int gfx_v8_0_compute_ring_init(struct 
> amdgpu_device *adev, int ring_id,
>   + ((ring->me - 1) * adev->gfx.mec.num_pipe_per_mec)
>   + ring->pipe;
>  
> - hw_prio = amdgpu_gfx_is_high_priority_compute_queue(adev, ring->queue) ?
> + hw_prio = amdgpu_gfx_is_high_priority_compute_queue(adev, ring->pipe,
> + ring->queue) ?
>   

RE: [PATCH 5/5] drm/amdgpu: disable rom clock gating support for APUs

2020-11-10 Thread Clements, John
[AMD Official Use Only - Internal Distribution Only]

Reviewed-by: John Clements 

-Original Message-
From: amd-gfx  On Behalf Of Hawking Zhang
Sent: Monday, November 9, 2020 4:17 PM
To: amd-gfx@lists.freedesktop.org
Cc: Zhang, Hawking 
Subject: [PATCH 5/5] drm/amdgpu: disable rom clock gating support for APUs

ROM clock gating enable/disable is not supported on APU platform. (i.e. 
CGTT_ROM_CLK_CTRL0 register is not availabe on APU). SMUIO callbacks will check 
APU flag before enable/disable rom clock gating, and skip the programming. 
Accordingly, query clock gating status through CGTT_ROM_CLK_CTRL0 also doesn't 
support on APU platform.

The change applies to RAVEN/RAVEN2/PICASSO/RENOIR.

Signed-off-by: Hawking Zhang 
Reviewed-by: Alex Deucher 
---
 drivers/gpu/drm/amd/amdgpu/soc15.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c 
b/drivers/gpu/drm/amd/amdgpu/soc15.c
index 7d3788c..8a23636 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -1169,7 +1169,6 @@ static int soc15_common_early_init(void *handle)
AMD_CG_SUPPORT_GFX_CGLS |
AMD_CG_SUPPORT_BIF_LS |
AMD_CG_SUPPORT_HDP_LS |
-   AMD_CG_SUPPORT_ROM_MGCG |
AMD_CG_SUPPORT_MC_MGCG |
AMD_CG_SUPPORT_MC_LS |
AMD_CG_SUPPORT_SDMA_MGCG |
@@ -1187,7 +1186,6 @@ static int soc15_common_early_init(void *handle)
AMD_CG_SUPPORT_GFX_CGLS |
AMD_CG_SUPPORT_BIF_LS |
AMD_CG_SUPPORT_HDP_LS |
-   AMD_CG_SUPPORT_ROM_MGCG |
AMD_CG_SUPPORT_MC_MGCG |
AMD_CG_SUPPORT_MC_LS |
AMD_CG_SUPPORT_SDMA_MGCG |
@@ -1211,7 +1209,6 @@ static int soc15_common_early_init(void *handle)
AMD_CG_SUPPORT_HDP_LS |
AMD_CG_SUPPORT_DRM_MGCG |
AMD_CG_SUPPORT_DRM_LS |
-   AMD_CG_SUPPORT_ROM_MGCG |
AMD_CG_SUPPORT_MC_MGCG |
AMD_CG_SUPPORT_MC_LS |
AMD_CG_SUPPORT_SDMA_MGCG |
@@ -1264,7 +1261,6 @@ static int soc15_common_early_init(void *handle)
 AMD_CG_SUPPORT_SDMA_LS |
 AMD_CG_SUPPORT_BIF_LS |
 AMD_CG_SUPPORT_HDP_LS |
-AMD_CG_SUPPORT_ROM_MGCG |
 AMD_CG_SUPPORT_VCN_MGCG |
 AMD_CG_SUPPORT_JPEG_MGCG |
 AMD_CG_SUPPORT_IH_CG |
--
2.7.4

___
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%7Cjohn.clements%40amd.com%7C5304c5c8408143f3733e08d88487e5ca%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637405066507439386%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=ZGqNyyHZ3Fy%2Fe3SpP9nbSCaR%2FXHAnQIaVv414Tdg1iM%3Dreserved=0
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH 2/2] drm/amd/pm: update the swSMU headers for vangogh

2020-11-10 Thread Xiaojian Du
This patch is to update the swSMU headers for vangogh.

Signed-off-by: Xiaojian Du 
Reviewed-by: Huang Rui 
Reviewed-by: Evan Quan 
---
 drivers/gpu/drm/amd/pm/inc/smu11_driver_if_vangogh.h |  6 ++
 drivers/gpu/drm/amd/pm/inc/smu_v11_5_pmfw.h  | 11 +++
 drivers/gpu/drm/amd/pm/inc/smu_v11_5_ppsmc.h | 11 +--
 3 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/inc/smu11_driver_if_vangogh.h 
b/drivers/gpu/drm/amd/pm/inc/smu11_driver_if_vangogh.h
index 8f438c80132e..1c19eae93ff1 100644
--- a/drivers/gpu/drm/amd/pm/inc/smu11_driver_if_vangogh.h
+++ b/drivers/gpu/drm/amd/pm/inc/smu11_driver_if_vangogh.h
@@ -142,6 +142,12 @@ typedef struct {
 
   uint8_t NumDfPstatesEnabled;
   uint8_t NumDpmLevelsEnabled;
+  uint8_t NumDcfclkLevelsEnabled;
+  uint8_t NumDispClkLevelsEnabled;  //applies to both dispclk and dppclk
+  uint8_t NumSocClkLevelsEnabled;
+
+  uint8_t IspClkLevelsEnabled;  //applies to both ispiclk and ispxclk
+  uint8_t VcnClkLevelsEnabled;  //applies to both vclk/dclk
   uint8_t spare[2];
 } DpmClocks_t;
 
diff --git a/drivers/gpu/drm/amd/pm/inc/smu_v11_5_pmfw.h 
b/drivers/gpu/drm/amd/pm/inc/smu_v11_5_pmfw.h
index 99a406984135..22edd88b8117 100644
--- a/drivers/gpu/drm/amd/pm/inc/smu_v11_5_pmfw.h
+++ b/drivers/gpu/drm/amd/pm/inc/smu_v11_5_pmfw.h
@@ -90,14 +90,16 @@
 #define FEATURE_ATHUB_PG_BIT  56
 #define FEATURE_ECO_DEEPCSTATE_BIT57
 #define FEATURE_CC6_BIT   58
-#define NUM_FEATURES  59
+#define FEATURE_GFX_EDC_BIT   59
+#define NUM_FEATURES  60
 
 typedef struct {
   // MP1_EXT_SCRATCH0
   uint32_t DpmHandlerID : 8;
   uint32_t ActivityMonitorID: 8;
   uint32_t DpmTimerID   : 8;
-  uint32_t spare0   : 8;
+  uint32_t DpmHubID : 4;
+  uint32_t DpmHubTask   : 4;
   // MP1_EXT_SCRATCH1
   uint32_t GfxStatus: 2;
   uint32_t GfxoffStatus : 8;
@@ -109,9 +111,10 @@ typedef struct {
   uint32_t spare1   : 16;
   // MP1_EXT_SCRATCH2
   uint32_t P2JobHandler: 32;
-  // MP1_EXT_SCRATCH3
-//  uint32_t spare2   : 32;
+  // MP1_EXT_SCRATCH3: used for postcodes
+
   // MP1_EXT_SCRATCH4:6 are used by Kernel
+  // MP1_EXT_SCRATCH7: used by HW
 } FwStatus_t;
 
 
diff --git a/drivers/gpu/drm/amd/pm/inc/smu_v11_5_ppsmc.h 
b/drivers/gpu/drm/amd/pm/inc/smu_v11_5_ppsmc.h
index 1ada0eb64663..7e69b3bd311b 100644
--- a/drivers/gpu/drm/amd/pm/inc/smu_v11_5_ppsmc.h
+++ b/drivers/gpu/drm/amd/pm/inc/smu_v11_5_ppsmc.h
@@ -97,9 +97,16 @@
 #define PPSMC_MSG_StopDramLogging  0x3F
 #define PPSMC_MSG_SetSoftMinCclk   0x40
 #define PPSMC_MSG_SetSoftMaxCclk   0x41
-#define PPSMC_Message_Count0x42
+#define PPSMC_MSG_SetDfPstateActiveLevel   0x42
+#define PPSMC_MSG_SetDfPstateSoftMinLevel  0x43
+#define PPSMC_MSG_SetCclkPolicy0x44
+#define PPSMC_MSG_DramLogSetDramAddrHigh   0x45
+#define PPSMC_MSG_DramLogSetDramBufferSize 0x46
+#define PPSMC_MSG_RequestActiveWgp 0x47
+#define PPSMC_MSG_QueryActiveWgp   0x48
+#define PPSMC_Message_Count0x49
 
-//Argument for  PPSMC_MSG_GpuChangeState
+//Argument for PPSMC_MSG_GfxDeviceDriverReset
 enum {
   MODE1_RESET = 1,
   MODE2_RESET = 2
-- 
2.17.1

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


[PATCH 1/2] drm/amd/pm: add the interface to dump smu metrics table for vangogh

2020-11-10 Thread Xiaojian Du
This patch is to add the interface to dump smu metrics table for vangogh.

Signed-off-by: Xiaojian Du 
Reviewed-by: Huang Rui 
Reviewed-by: Evan Quan 
---
 drivers/gpu/drm/amd/pm/inc/smu_v11_0.h|  2 +
 .../gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c| 12 +
 .../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c  | 52 +++
 3 files changed, 66 insertions(+)

diff --git a/drivers/gpu/drm/amd/pm/inc/smu_v11_0.h 
b/drivers/gpu/drm/amd/pm/inc/smu_v11_0.h
index dc06459af91c..5ad693312187 100644
--- a/drivers/gpu/drm/amd/pm/inc/smu_v11_0.h
+++ b/drivers/gpu/drm/amd/pm/inc/smu_v11_0.h
@@ -276,6 +276,8 @@ int smu_v11_0_get_current_pcie_link_speed(struct 
smu_context *smu);
 
 void smu_v11_0_init_gpu_metrics_v1_0(struct gpu_metrics_v1_0 *gpu_metrics);
 
+void smu_v11_0_init_gpu_metrics_v2_0(struct gpu_metrics_v2_0 *gpu_metrics);
+
 int smu_v11_0_gfx_ulv_control(struct smu_context *smu,
  bool enablement);
 
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 6b7d1335b46d..b880c72c322c 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
@@ -1999,6 +1999,18 @@ void smu_v11_0_init_gpu_metrics_v1_0(struct 
gpu_metrics_v1_0 *gpu_metrics)
gpu_metrics->system_clock_counter = ktime_get_boottime_ns();
 }
 
+void smu_v11_0_init_gpu_metrics_v2_0(struct gpu_metrics_v2_0 *gpu_metrics)
+{
+   memset(gpu_metrics, 0xFF, sizeof(struct gpu_metrics_v2_0));
+
+   gpu_metrics->common_header.structure_size =
+   sizeof(struct gpu_metrics_v2_0);
+   gpu_metrics->common_header.format_revision = 2;
+   gpu_metrics->common_header.content_revision = 0;
+
+   gpu_metrics->system_clock_counter = ktime_get_boottime_ns();
+}
+
 int smu_v11_0_gfx_ulv_control(struct smu_context *smu,
  bool enablement)
 {
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c 
b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
index 83a1b0a04eb1..cbcbcd8514f0 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
@@ -584,6 +584,57 @@ static int vangogh_set_watermarks_table(struct smu_context 
*smu,
return 0;
 }
 
+static ssize_t vangogh_get_gpu_metrics(struct smu_context *smu,
+ void **table)
+{
+   struct smu_table_context *smu_table = >smu_table;
+   struct gpu_metrics_v2_0 *gpu_metrics =
+   (struct gpu_metrics_v2_0 *)smu_table->gpu_metrics_table;
+   SmuMetrics_t metrics;
+   int ret = 0;
+
+   ret = smu_cmn_get_metrics_table(smu, , true);
+   if (ret)
+   return ret;
+
+   smu_v11_0_init_gpu_metrics_v2_0(gpu_metrics);
+
+   gpu_metrics->temperature_gfx = metrics.GfxTemperature;
+   gpu_metrics->temperature_soc = metrics.SocTemperature;
+   memcpy(_metrics->temperature_core[0],
+   [0],
+   sizeof(uint16_t) * 8);
+   gpu_metrics->temperature_l3[0] = metrics.L3Temperature[0];
+   gpu_metrics->temperature_l3[1] = metrics.L3Temperature[1];
+
+   gpu_metrics->average_gfx_activity = metrics.GfxActivity;
+   gpu_metrics->average_mm_activity = metrics.UvdActivity;
+
+   gpu_metrics->average_socket_power = metrics.CurrentSocketPower;
+   gpu_metrics->average_cpu_power = metrics.Power[0];
+   gpu_metrics->average_soc_power = metrics.Power[1];
+   memcpy(_metrics->average_core_power[0],
+   [0],
+   sizeof(uint16_t) * 8);
+
+   gpu_metrics->average_gfxclk_frequency = metrics.GfxclkFrequency;
+   gpu_metrics->average_socclk_frequency = metrics.SocclkFrequency;
+   gpu_metrics->average_fclk_frequency = metrics.MemclkFrequency;
+   gpu_metrics->average_vclk_frequency = metrics.VclkFrequency;
+
+   memcpy(_metrics->current_coreclk[0],
+   [0],
+   sizeof(uint16_t) * 8);
+   gpu_metrics->current_l3clk[0] = metrics.L3Frequency[0];
+   gpu_metrics->current_l3clk[1] = metrics.L3Frequency[1];
+
+   gpu_metrics->throttle_status = metrics.ThrottlerStatus;
+
+   *table = (void *)gpu_metrics;
+
+   return sizeof(struct gpu_metrics_v2_0);
+}
+
 static const struct pptable_funcs vangogh_ppt_funcs = {
 
.check_fw_status = smu_v11_0_check_fw_status,
@@ -607,6 +658,7 @@ static const struct pptable_funcs vangogh_ppt_funcs = {
.set_driver_table_location = smu_v11_0_set_driver_table_location,
.disable_all_features_with_exception = 
smu_cmn_disable_all_features_with_exception,
.interrupt_work = smu_v11_0_interrupt_work,
+   .get_gpu_metrics = vangogh_get_gpu_metrics,
 };
 
 void vangogh_set_ppt_funcs(struct smu_context *smu)
-- 
2.17.1

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


RE:R [PATCH] drm/amd/amdgpu: Update VCN initizalization behvaior

2020-11-10 Thread Liu, Monk
[AMD Official Use Only - Internal Distribution Only]

Reviewed-by: Monk Liu 

_
Monk Liu|GPU Virtualization Team |AMD


-Original Message-
From: amd-gfx  On Behalf Of Bokun Zhang
Sent: Wednesday, November 11, 2020 4:17 AM
To: amd-gfx@lists.freedesktop.org
Cc: Zhang, Bokun 
Subject: [PATCH] drm/amd/amdgpu: Update VCN initizalization behvaior

- Issue:
  In the original vcn3.0 code, it assumes that the VCN's
  init_status is always 1, even after the MMSCH
  updates the header.

  This is incorrect since by default, it should be set to 0,
  and MMSCH will update it to 1 if VCN is ready.

- Fix:
  We need to read back the table header after send it to MMSCH.
  After that, if a VCN instance is not ready (host disabled it),
  we needs to disable the ring buffer as well.

Change-Id: I2c5dc4344c5919044370dfe606bf5980a202c662

Signed-off-by: Bokun Zhang 
---
 drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 46 +--
 1 file changed, 37 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c 
b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
index 3970a0ccb6a5..c5e0a531caba 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
@@ -294,17 +294,19 @@ static int vcn_v3_0_hw_init(void *handle)
 continue;

 ring = >vcn.inst[i].ring_dec;
-ring->wptr = 0;
-ring->wptr_old = 0;
-vcn_v3_0_dec_ring_set_wptr(ring);
-ring->sched.ready = true;
+if (ring->sched.ready) {
+ring->wptr = 0;
+ring->wptr_old = 0;
+vcn_v3_0_dec_ring_set_wptr(ring);
+}

 for (j = 0; j < adev->vcn.num_enc_rings; ++j) {
 ring = >vcn.inst[i].ring_enc[j];
-ring->wptr = 0;
-ring->wptr_old = 0;
-vcn_v3_0_enc_ring_set_wptr(ring);
-ring->sched.ready = true;
+if (ring->sched.ready) {
+ring->wptr = 0;
+ring->wptr_old = 0;
+vcn_v3_0_enc_ring_set_wptr(ring);
+}
 }
 }
 } else {
@@ -1230,6 +1232,8 @@ static int vcn_v3_0_start_sriov(struct amdgpu_device 
*adev)
 uint32_t table_size;
 uint32_t size, size_dw;

+bool is_vcn_ready;
+
 struct mmsch_v3_0_cmd_direct_write
 direct_wt = { {0} };
 struct mmsch_v3_0_cmd_direct_read_modify_write
@@ -1367,7 +1371,7 @@ static int vcn_v3_0_start_sriov(struct amdgpu_device 
*adev)
 MMSCH_V3_0_INSERT_END();

 /* refine header */
-header.inst[i].init_status = 1;
+header.inst[i].init_status = 0;
 header.inst[i].table_offset = header.total_size;
 header.inst[i].table_size = table_size;
 header.total_size += table_size;
@@ -1425,6 +1429,30 @@ static int vcn_v3_0_start_sriov(struct amdgpu_device 
*adev)
 }
 }

+/* 6, check each VCN's init_status
+ * if it remains as 0, then this VCN is not assigned to current VF
+ * do not start ring for this VCN
+ */
+size = sizeof(struct mmsch_v3_0_init_header);
+table_loc = (uint32_t *)table->cpu_addr;
+memcpy(, (void *)table_loc, size);
+
+for (i = 0; i < adev->vcn.num_vcn_inst; i++) {
+if (adev->vcn.harvest_config & (1 << i))
+continue;
+
+is_vcn_ready = (header.inst[i].init_status == 1);
+if (!is_vcn_ready)
+DRM_INFO("VCN(%d) engine is disabled by hypervisor\n", i);
+
+ring = >vcn.inst[i].ring_dec;
+ring->sched.ready = is_vcn_ready;
+for (j = 0; j < adev->vcn.num_enc_rings; ++j) {
+ring = >vcn.inst[i].ring_enc[j];
+ring->sched.ready = is_vcn_ready;
+}
+}
+
 return 0;
 }

--
2.20.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%7Cmonk.liu%40amd.com%7Ccb49c2c170054afa706808d885b5aabb%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637406362602342785%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=gyfneg3amwv16LJD6tjP6hoo%2F615ODNCOsOU%2BJ6JbuQ%3Dreserved=0
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH 0/3] amdgpu getfb2+modifier improvements

2020-11-10 Thread Bas Nieuwenhuizen
This has some more improvements for the addfb2 code in amdgpu.

These patches make ffmpeg work with DCC compressed and YUV surfaces
with kmsgrab, both in the modifier and non-modifier case.

Bas Nieuwenhuizen (3):
  drm/amd/display: Store gem objects for planes 1-3
  drm/amd/display: Set new format info for converted metadata.
  drm/amd/display: Extract 3rd plane from metadata

 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c   | 211 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.h   |   2 +
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  88 +---
 3 files changed, 207 insertions(+), 94 deletions(-)

-- 
2.29.2

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


[PATCH 3/3] drm/amd/display: Extract 3rd plane from metadata

2020-11-10 Thread Bas Nieuwenhuizen
Now that we actually expose the right number of planes we get
problems with modifier aware libva if we use an unsupported modifier.

So this ensures that we as much as possible use a modifier that
radeonsi can actually render to without going to extreme difficulty
to synchronize an extra DCC metadata plane with implicit sync.

Looking into the opaque metadata isn't ideal but this converts to
something mainly for the purpose of the userspace driver and falls
back properly if it isn't what we expect.

Signed-off-by: Bas Nieuwenhuizen 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 106 ++--
 1 file changed, 98 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index f66ce6ec4843..c9e98499b8a4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -631,6 +631,57 @@ amdgpu_lookup_format_info(u32 format, uint64_t modifier)
return NULL;
 }
 
+
+/*
+ * Tries to extract the renderable DCC offset from the opaque metadata attached
+ * to the buffer.
+ */
+static int
+extract_render_dcc_offset(struct amdgpu_device *adev,
+ struct drm_gem_object *obj,
+ uint64_t *offset)
+{
+   struct amdgpu_bo *rbo;
+   int r = 0;
+   uint32_t metadata[10]; /* Something that fits a descriptor + header. */
+   uint32_t size;
+
+   rbo = gem_to_amdgpu_bo(obj);
+   r = amdgpu_bo_reserve(rbo, false);
+
+   if (unlikely(r)) {
+   /* Don't show error message when returning -ERESTARTSYS */
+   if (r != -ERESTARTSYS)
+   DRM_ERROR("Unable to reserve buffer: %d\n", r);
+   return r;
+   }
+
+   r = amdgpu_bo_get_metadata(rbo, metadata, sizeof(metadata), , 
NULL);
+   amdgpu_bo_unreserve(rbo);
+
+   if (r)
+   return r;
+
+   /*
+* The first word is the metadata version, and we need space for at 
least
+* the version + pci vendor+device id + 8 words for a descriptor.
+*/
+   if (size < 40  || metadata[0] != 1)
+   return -EINVAL;
+
+   if (adev->family >= AMDGPU_FAMILY_NV) {
+   /* resource word 6/7 META_DATA_ADDRESS{_LO} */
+   *offset = ((u64)metadata[9] << 16u) |
+ ((metadata[8] & 0xFF00u) >> 16);
+   } else {
+   /* resource word 5/7 META_DATA_ADDRESS */
+   *offset = ((u64)metadata[9] << 8u) |
+ ((u64)(metadata[7] & 0x1FEu) << 23);
+   }
+
+   return 0;
+}
+
 static int convert_tiling_flags_to_modifier(struct amdgpu_framebuffer *afb)
 {
struct amdgpu_device *adev = drm_to_adev(afb->base.dev);
@@ -646,6 +697,8 @@ static int convert_tiling_flags_to_modifier(struct 
amdgpu_framebuffer *afb)
int pipe_xor_bits = 0;
int bank_xor_bits = 0;
int packers = 0;
+   int rb = 0;
+   int pipes = 
ilog2(adev->gfx.config.gb_addr_config_fields.num_pipes);
uint32_t dcc_offset = AMDGPU_TILING_GET(afb->tiling_flags, 
DCC_OFFSET_256B);
 
switch (swizzle >> 2) {
@@ -691,18 +744,17 @@ static int convert_tiling_flags_to_modifier(struct 
amdgpu_framebuffer *afb)
if (has_xor) {
switch (version) {
case AMD_FMT_MOD_TILE_VER_GFX10_RBPLUS:
-   pipe_xor_bits = min(block_size_bits - 8,
-   
ilog2(adev->gfx.config.gb_addr_config_fields.num_pipes));
+   pipe_xor_bits = min(block_size_bits - 8, pipes);
packers = min(block_size_bits - 8 - 
pipe_xor_bits,
  
ilog2(adev->gfx.config.gb_addr_config_fields.num_pkrs));
break;
case AMD_FMT_MOD_TILE_VER_GFX10:
-   pipe_xor_bits = min(block_size_bits - 8,
-   
ilog2(adev->gfx.config.gb_addr_config_fields.num_pipes));
+   pipe_xor_bits = min(block_size_bits - 8, pipes);
break;
case AMD_FMT_MOD_TILE_VER_GFX9:
-   pipe_xor_bits = min(block_size_bits - 8,
-   
ilog2(adev->gfx.config.gb_addr_config_fields.num_pipes) +
+   rb = 
ilog2(adev->gfx.config.gb_addr_config_fields.num_se) +
+
ilog2(adev->gfx.config.gb_addr_config_fields.num_rb_per_se);
+   pipe_xor_bits = min(block_size_bits - 8, pipes +

ilog2(adev->gfx.config.gb_addr_config_fields.num_se));
   

[PATCH 1/3] drm/amd/display: Store gem objects for planes 1-3

2020-11-10 Thread Bas Nieuwenhuizen
Also do the proper validation which was missed.

Besides the missing validation, not storing the objects in the
framebuffer led to wrong results in the getfb2 ioctl.

Note that this should really have been done for multi-plane
formats like NV12 already before modifiers landed.

Signed-off-by: Bas Nieuwenhuizen 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 20 +++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index 89c3ead36501..e33acc3de286 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -695,13 +695,26 @@ int amdgpu_display_framebuffer_init(struct drm_device 
*dev,
const struct drm_mode_fb_cmd2 *mode_cmd,
struct drm_gem_object *obj)
 {
-   int ret;
+   int ret, i;
rfb->base.obj[0] = obj;
drm_helper_mode_fill_fb_struct(dev, >base, mode_cmd);
ret = drm_framebuffer_init(dev, >base, _fb_funcs);
if (ret)
goto fail;
 
+   /*
+* This needs to happen before modifier conversion as that might change
+* the number of planes.
+*/
+   for (i = 1; i < rfb->base.format->num_planes; ++i) {
+   if (mode_cmd->handles[i] != mode_cmd->handles[0]) {
+   dev_err(>pdev->dev, "Plane 0 and %d have different 
BOs: %u vs. %u\n",
+   i, mode_cmd->handles[0], mode_cmd->handles[i]);
+   ret = -EINVAL;
+   goto fail;
+   }
+   }
+
ret = amdgpu_display_get_fb_info(rfb, >tiling_flags, 
>tmz_surface);
if (ret)
goto fail;
@@ -713,6 +726,11 @@ int amdgpu_display_framebuffer_init(struct drm_device *dev,
goto fail;
}
 
+   for (i = 1; i < rfb->base.format->num_planes; ++i) {
+   rfb->base.obj[i] = rfb->base.obj[0];
+   drm_gem_object_get(rfb->base.obj[i]);
+   }
+
return 0;
 
 fail:
-- 
2.29.2

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


[PATCH 2/3] drm/amd/display: Set new format info for converted metadata.

2020-11-10 Thread Bas Nieuwenhuizen
If we use DCC modifiers this can increase the number of planes from
the initial 1 plane with metadata, so that we get a valid modifier
from getfb2.

Since the code didn't update the format_info getfb2 would only ever
return 1 plane with a modifier for which userspace expects > 1.

This moves the format lookup to amdgpu_display.c so we do not have
issues when DC is not compiled.

Signed-off-by: Bas Nieuwenhuizen 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c   | 97 +++
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.h   |  2 +
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 88 +
 3 files changed, 100 insertions(+), 87 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index e33acc3de286..f66ce6ec4843 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -542,6 +542,95 @@ uint32_t amdgpu_display_supported_domains(struct 
amdgpu_device *adev,
return domain;
 }
 
+static const struct drm_format_info dcc_formats[] = {
+   { .format = DRM_FORMAT_XRGB, .depth = 24, .num_planes = 2,
+ .cpp = { 4, 0, }, .block_w = {1, 1, 1}, .block_h = {1, 1, 1}, .hsub = 
1, .vsub = 1, },
+{ .format = DRM_FORMAT_XBGR, .depth = 24, .num_planes = 2,
+ .cpp = { 4, 0, }, .block_w = {1, 1, 1}, .block_h = {1, 1, 1}, .hsub = 
1, .vsub = 1, },
+   { .format = DRM_FORMAT_ARGB, .depth = 32, .num_planes = 2,
+ .cpp = { 4, 0, }, .block_w = {1, 1, 1}, .block_h = {1, 1, 1}, .hsub = 
1, .vsub = 1,
+  .has_alpha = true, },
+   { .format = DRM_FORMAT_ABGR, .depth = 32, .num_planes = 2,
+ .cpp = { 4, 0, }, .block_w = {1, 1, 1}, .block_h = {1, 1, 1}, .hsub = 
1, .vsub = 1,
+ .has_alpha = true, },
+   { .format = DRM_FORMAT_BGRA, .depth = 32, .num_planes = 2,
+ .cpp = { 4, 0, }, .block_w = {1, 1, 1}, .block_h = {1, 1, 1}, .hsub = 
1, .vsub = 1,
+ .has_alpha = true, },
+   { .format = DRM_FORMAT_XRGB2101010, .depth = 30, .num_planes = 2,
+ .cpp = { 4, 0, }, .block_w = {1, 1, 1}, .block_h = {1, 1, 1}, .hsub = 
1, .vsub = 1, },
+   { .format = DRM_FORMAT_XBGR2101010, .depth = 30, .num_planes = 2,
+ .cpp = { 4, 0, }, .block_w = {1, 1, 1}, .block_h = {1, 1, 1}, .hsub = 
1, .vsub = 1, },
+   { .format = DRM_FORMAT_ARGB2101010, .depth = 30, .num_planes = 2,
+ .cpp = { 4, 0, }, .block_w = {1, 1, 1}, .block_h = {1, 1, 1}, .hsub = 
1, .vsub = 1,
+ .has_alpha = true, },
+   { .format = DRM_FORMAT_ABGR2101010, .depth = 30, .num_planes = 2,
+ .cpp = { 4, 0, }, .block_w = {1, 1, 1}, .block_h = {1, 1, 1}, .hsub = 
1, .vsub = 1,
+ .has_alpha = true, },
+   { .format = DRM_FORMAT_RGB565, .depth = 16, .num_planes = 2,
+ .cpp = { 2, 0, }, .block_w = {1, 1, 1}, .block_h = {1, 1, 1}, .hsub = 
1, .vsub = 1, },
+};
+
+static const struct drm_format_info dcc_retile_formats[] = {
+   { .format = DRM_FORMAT_XRGB, .depth = 24, .num_planes = 3,
+ .cpp = { 4, 0, 0 }, .block_w = {1, 1, 1}, .block_h = {1, 1, 1}, .hsub 
= 1, .vsub = 1, },
+{ .format = DRM_FORMAT_XBGR, .depth = 24, .num_planes = 3,
+ .cpp = { 4, 0, 0 }, .block_w = {1, 1, 1}, .block_h = {1, 1, 1}, .hsub 
= 1, .vsub = 1, },
+   { .format = DRM_FORMAT_ARGB, .depth = 32, .num_planes = 3,
+ .cpp = { 4, 0, 0 }, .block_w = {1, 1, 1}, .block_h = {1, 1, 1}, .hsub 
= 1, .vsub = 1,
+  .has_alpha = true, },
+   { .format = DRM_FORMAT_ABGR, .depth = 32, .num_planes = 3,
+ .cpp = { 4, 0, 0 }, .block_w = {1, 1, 1}, .block_h = {1, 1, 1}, .hsub 
= 1, .vsub = 1,
+ .has_alpha = true, },
+   { .format = DRM_FORMAT_BGRA, .depth = 32, .num_planes = 3,
+ .cpp = { 4, 0, 0 }, .block_w = {1, 1, 1}, .block_h = {1, 1, 1}, .hsub 
= 1, .vsub = 1,
+ .has_alpha = true, },
+   { .format = DRM_FORMAT_XRGB2101010, .depth = 30, .num_planes = 3,
+ .cpp = { 4, 0, 0 }, .block_w = {1, 1, 1}, .block_h = {1, 1, 1}, .hsub 
= 1, .vsub = 1, },
+   { .format = DRM_FORMAT_XBGR2101010, .depth = 30, .num_planes = 3,
+ .cpp = { 4, 0, 0 }, .block_w = {1, 1, 1}, .block_h = {1, 1, 1}, .hsub 
= 1, .vsub = 1, },
+   { .format = DRM_FORMAT_ARGB2101010, .depth = 30, .num_planes = 3,
+ .cpp = { 4, 0, 0 }, .block_w = {1, 1, 1}, .block_h = {1, 1, 1}, .hsub 
= 1, .vsub = 1,
+ .has_alpha = true, },
+   { .format = DRM_FORMAT_ABGR2101010, .depth = 30, .num_planes = 3,
+ .cpp = { 4, 0, 0 }, .block_w = {1, 1, 1}, .block_h = {1, 1, 1}, .hsub 
= 1, .vsub = 1,
+ .has_alpha = true, },
+   { .format = DRM_FORMAT_RGB565, .depth = 16, .num_planes = 3,
+ .cpp = { 2, 0, 0 }, .block_w = {1, 1, 1}, .block_h = {1, 1, 1}, .hsub 
= 1, .vsub = 1, },
+};
+
+static const struct drm_format_info *
+lookup_format_info(const struct drm_format_info formats[],
+ int 

Re: [PATCH 15/19] gpu: drm: radeon: radeon_drv: Remove unused variable 'ret'

2020-11-10 Thread Lee Jones
On Tue, 10 Nov 2020, Alex Deucher wrote:

> On Thu, Nov 5, 2020 at 9:52 AM Lee Jones  wrote:
> >
> > Fixes the following W=1 kernel build warning(s):
> >
> >  drivers/gpu/drm/radeon/radeon_drv.c: In function 
> > ‘radeon_pmops_runtime_suspend’:
> >  drivers/gpu/drm/radeon/radeon_drv.c:455:6: warning: variable ‘ret’ set but 
> > not used [-Wunused-but-set-variable]
> >
> > 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!

Thanks Alex.

I'll rebase in a few days and fix/resend whatever is outstanding.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 25/30] drm/radeon/sumo_dpm: Move 'sumo_get_pi()'s prototype into shared header

2020-11-10 Thread Alex Deucher
On Tue, Nov 10, 2020 at 2:32 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/sumo_dpm.c:81:25: warning: no previous prototype for 
> ‘sumo_get_pi’ [-Wmissing-prototypes]
>  81 | struct sumo_power_info *sumo_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/sumo_dpm.h | 1 +
>  drivers/gpu/drm/radeon/sumo_smc.c | 2 --
>  2 files changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/sumo_dpm.h 
> b/drivers/gpu/drm/radeon/sumo_dpm.h
> index f1651135a47ab..db29d37ae2703 100644
> --- a/drivers/gpu/drm/radeon/sumo_dpm.h
> +++ b/drivers/gpu/drm/radeon/sumo_dpm.h
> @@ -207,6 +207,7 @@ u32 sumo_get_sleep_divider_from_id(u32 id);
>  u32 sumo_get_sleep_divider_id_from_clock(struct radeon_device *rdev,
>  u32 sclk,
>  u32 min_sclk_in_sr);
> +struct sumo_power_info *sumo_get_pi(struct radeon_device *rdev);
>
>  /* sumo_smc.c */
>  void sumo_initialize_m3_arb(struct radeon_device *rdev);
> diff --git a/drivers/gpu/drm/radeon/sumo_smc.c 
> b/drivers/gpu/drm/radeon/sumo_smc.c
> index d781407057366..78d8716067318 100644
> --- a/drivers/gpu/drm/radeon/sumo_smc.c
> +++ b/drivers/gpu/drm/radeon/sumo_smc.c
> @@ -30,8 +30,6 @@
>  #define SUMO_SMU_SERVICE_ROUTINE_ALTVDDNB_NOTIFY  27
>  #define SUMO_SMU_SERVICE_ROUTINE_GFX_SRV_ID_20  20
>
> -struct sumo_power_info *sumo_get_pi(struct radeon_device *rdev);
> -
>  static void sumo_send_msg_to_smu(struct radeon_device *rdev, u32 id)
>  {
> u32 gfx_int_req;
> --
> 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 27/30] drm/radeon/ni: Remove set but unused variable 'mc_shared_chmap'

2020-11-10 Thread Alex Deucher
On Tue, Nov 10, 2020 at 2:32 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/ni.c: In function ‘cayman_gpu_init’:
>  drivers/gpu/drm/radeon/ni.c:880:6: warning: variable ‘mc_shared_chmap’ set 
> but not used [-Wunused-but-set-variable]
>
> 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.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
> index 12dd082069649..1c9030a4631b8 100644
> --- a/drivers/gpu/drm/radeon/ni.c
> +++ b/drivers/gpu/drm/radeon/ni.c
> @@ -877,7 +877,7 @@ int tn_get_temp(struct radeon_device *rdev)
>  static void cayman_gpu_init(struct radeon_device *rdev)
>  {
> u32 gb_addr_config = 0;
> -   u32 mc_shared_chmap, mc_arb_ramcfg;
> +   u32 mc_arb_ramcfg;
> u32 cgts_tcc_disable;
> u32 sx_debug_1;
> u32 smx_dc_ctl0;
> @@ -1002,7 +1002,7 @@ static void cayman_gpu_init(struct radeon_device *rdev)
>
> evergreen_fix_pci_max_read_req_size(rdev);
>
> -   mc_shared_chmap = RREG32(MC_SHARED_CHMAP);
> +   RREG32(MC_SHARED_CHMAP);
> mc_arb_ramcfg = RREG32(MC_ARB_RAMCFG);
>
> tmp = (mc_arb_ramcfg & NOOFCOLS_MASK) >> NOOFCOLS_SHIFT;
> --
> 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/30] drm/radeon/evergreen_dma: Fix doc-rot of function parameter 'resv'

2020-11-10 Thread Alex Deucher
On Tue, Nov 10, 2020 at 2:31 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/evergreen_dma.c:112: warning: Function parameter or 
> member 'resv' not described in 'evergreen_copy_dma'
>  drivers/gpu/drm/radeon/evergreen_dma.c:112: warning: Excess function 
> parameter 'fence' description in 'evergreen_copy_dma'
>
> 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/evergreen_dma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/evergreen_dma.c 
> b/drivers/gpu/drm/radeon/evergreen_dma.c
> index a46ee6c2099dd..767857d4a8c5c 100644
> --- a/drivers/gpu/drm/radeon/evergreen_dma.c
> +++ b/drivers/gpu/drm/radeon/evergreen_dma.c
> @@ -98,7 +98,7 @@ void evergreen_dma_ring_ib_execute(struct radeon_device 
> *rdev,
>   * @src_offset: src GPU address
>   * @dst_offset: dst GPU address
>   * @num_gpu_pages: number of GPU pages to xfer
> - * @fence: radeon fence object
> + * @resv: reservation object with embedded fence
>   *
>   * Copy GPU paging using the DMA engine (evergreen-cayman).
>   * Used by the radeon ttm implementation to move pages if
> --
> 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 18/30] drm/radeon/evergreen_cs: Fix misnaming issues surrounding 'p' param

2020-11-10 Thread Alex Deucher
On Tue, Nov 10, 2020 at 2:31 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/evergreen_cs.c:1026: warning: Function parameter or 
> member 'p' not described in 'evergreen_cs_packet_parse_vline'
>  drivers/gpu/drm/radeon/evergreen_cs.c:1026: warning: Excess function 
> parameter 'parser' description in 'evergreen_cs_packet_parse_vline'
>  drivers/gpu/drm/radeon/evergreen_cs.c:1095: warning: Function parameter or 
> member 'p' not described in 'evergreen_cs_handle_reg'
>  drivers/gpu/drm/radeon/evergreen_cs.c:1095: warning: Excess function 
> parameter 'parser' description in 'evergreen_cs_handle_reg'
>  drivers/gpu/drm/radeon/evergreen_cs.c:1757: warning: Function parameter or 
> member 'p' not described in 'evergreen_is_safe_reg'
>  drivers/gpu/drm/radeon/evergreen_cs.c:1757: warning: Excess function 
> parameter 'parser' description in 'evergreen_is_safe_reg'
>
> 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 | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c 
> b/drivers/gpu/drm/radeon/evergreen_cs.c
> index c410cad28f19f..53b75cf201958 100644
> --- a/drivers/gpu/drm/radeon/evergreen_cs.c
> +++ b/drivers/gpu/drm/radeon/evergreen_cs.c
> @@ -1015,7 +1015,7 @@ static int evergreen_cs_track_check(struct 
> radeon_cs_parser *p)
>
>  /**
>   * evergreen_cs_packet_parse_vline() - parse userspace VLINE packet
> - * @parser:parser structure holding parsing context.
> + * @p: parser structure holding parsing context.
>   *
>   * This is an Evergreen(+)-specific function for parsing VLINE packets.
>   * Real work is done by r600_cs_common_vline_parse function.
> @@ -1087,7 +1087,7 @@ static int evergreen_cs_parse_packet0(struct 
> radeon_cs_parser *p,
>
>  /**
>   * evergreen_cs_handle_reg() - process registers that need special handling.
> - * @parser: parser structure holding parsing context
> + * @p: parser structure holding parsing context
>   * @reg: register we are testing
>   * @idx: index into the cs buffer
>   */
> @@ -1747,7 +1747,7 @@ static int evergreen_cs_handle_reg(struct 
> radeon_cs_parser *p, u32 reg, u32 idx)
>
>  /**
>   * evergreen_is_safe_reg() - check if register is authorized or not
> - * @parser: parser structure holding parsing context
> + * @p: parser structure holding parsing context
>   * @reg: register we are testing
>   *
>   * This function will test against reg_safe_bm and return true
> --
> 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 15/30] drm/radeon/cik_sdma: Demote vague attempt at kernel-doc

2020-11-10 Thread Alex Deucher
On Tue, Nov 10, 2020 at 2:31 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/cik_sdma.c:949: warning: Function parameter or member 
> 'ring' not described in 'cik_dma_vm_flush'
>  drivers/gpu/drm/radeon/cik_sdma.c:949: warning: Function parameter or member 
> 'vm_id' not described in 'cik_dma_vm_flush'
>  drivers/gpu/drm/radeon/cik_sdma.c:949: warning: Function parameter or member 
> 'pd_addr' not described in 'cik_dma_vm_flush'
>
> 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_sdma.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/cik_sdma.c 
> b/drivers/gpu/drm/radeon/cik_sdma.c
> index 68403e77756d3..3c709ebe8d1ab 100644
> --- a/drivers/gpu/drm/radeon/cik_sdma.c
> +++ b/drivers/gpu/drm/radeon/cik_sdma.c
> @@ -936,11 +936,9 @@ void cik_sdma_vm_pad_ib(struct radeon_ib *ib)
> ib->ptr[ib->length_dw++] = SDMA_PACKET(SDMA_OPCODE_NOP, 0, 0);
>  }
>
> -/**
> +/*
>   * cik_dma_vm_flush - cik vm flush using sDMA
>   *
> - * @rdev: radeon_device pointer
> - *
>   * Update the page table base and flush the VM TLB
>   * using sDMA (CIK).
>   */
> --
> 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 17/30] drm/radeon/r600_cs: Fix some doc-rot and supply missing function param docs

2020-11-10 Thread Alex Deucher
On Tue, Nov 10, 2020 at 2:31 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/r600_cs.c:793: warning: Function parameter or member 
> 'p' not described in 'r600_cs_packet_parse_vline'
>  drivers/gpu/drm/radeon/r600_cs.c:793: warning: Excess function parameter 
> 'parser' description in 'r600_cs_packet_parse_vline'
>  drivers/gpu/drm/radeon/r600_cs.c:826: warning: Function parameter or member 
> 'p' not described in 'r600_cs_common_vline_parse'
>  drivers/gpu/drm/radeon/r600_cs.c:826: warning: Excess function parameter 
> 'parser' description in 'r600_cs_common_vline_parse'
>  drivers/gpu/drm/radeon/r600_cs.c:968: warning: Function parameter or member 
> 'p' not described in 'r600_cs_check_reg'
>  drivers/gpu/drm/radeon/r600_cs.c:968: warning: Excess function parameter 
> 'parser' description in 'r600_cs_check_reg'
>  drivers/gpu/drm/radeon/r600_cs.c:1473: warning: Function parameter or member 
> 'base_offset' not described in 'r600_check_texture_resource'
>  drivers/gpu/drm/radeon/r600_cs.c:1473: warning: Function parameter or member 
> 'mip_offset' not described in 'r600_check_texture_resource'
>  drivers/gpu/drm/radeon/r600_cs.c:1473: warning: Function parameter or member 
> 'tiling_flags' not described in 'r600_check_texture_resource'
>
> 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_cs.c | 9 ++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/r600_cs.c 
> b/drivers/gpu/drm/radeon/r600_cs.c
> index 390a9621604ae..f20b619466816 100644
> --- a/drivers/gpu/drm/radeon/r600_cs.c
> +++ b/drivers/gpu/drm/radeon/r600_cs.c
> @@ -782,7 +782,7 @@ static int r600_cs_track_check(struct radeon_cs_parser *p)
>
>  /**
>   * r600_cs_packet_parse_vline() - parse userspace VLINE packet
> - * @parser:parser structure holding parsing context.
> + * @p: parser structure holding parsing context.
>   *
>   * This is an R600-specific function for parsing VLINE packets.
>   * Real work is done by r600_cs_common_vline_parse function.
> @@ -801,7 +801,7 @@ static int r600_cs_packet_parse_vline(struct 
> radeon_cs_parser *p)
>
>  /**
>   * r600_cs_common_vline_parse() - common vline parser
> - * @parser:parser structure holding parsing context.
> + * @p: parser structure holding parsing context.
>   * @vline_start_end:table of vline_start_end registers
>   * @vline_status:   table of vline_status registers
>   *
> @@ -956,7 +956,7 @@ static int r600_cs_parse_packet0(struct radeon_cs_parser 
> *p,
>
>  /**
>   * r600_cs_check_reg() - check if register is authorized or not
> - * @parser: parser structure holding parsing context
> + * @p: parser structure holding parsing context
>   * @reg: register we are testing
>   * @idx: index into the cs buffer
>   *
> @@ -1460,6 +1460,9 @@ static void r600_texture_size(unsigned nfaces, unsigned 
> blevel, unsigned llevel,
>   * @idx: index into the cs buffer
>   * @texture: texture's bo structure
>   * @mipmap: mipmap's bo structure
> + * @base_offset: base offset (used for error checking)
> + * @mip_offset: mip offset (used for error checking)
> + * @tiling_flags: tiling flags
>   *
>   * This function will check that the resource has valid field and that
>   * the texture and mipmap bo object are big enough to cover this resource.
> --
> 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 16/30] drm/radeon/r100: Fix some kernel-doc formatting, misnaming and missing issues

2020-11-10 Thread Alex Deucher
On Tue, Nov 10, 2020 at 2:31 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/r100.c:163: warning: Function parameter or member 
> 'async' not described in 'r100_page_flip'
>  drivers/gpu/drm/radeon/r100.c:848: warning: Function parameter or member 
> 'rdev' not described in 'r100_ring_hdp_flush'
>  drivers/gpu/drm/radeon/r100.c:848: warning: Function parameter or member 
> 'ring' not described in 'r100_ring_hdp_flush'
>  drivers/gpu/drm/radeon/r100.c:1425: warning: Function parameter or member 
> 'p' not described in 'r100_cs_packet_parse_vline'
>  drivers/gpu/drm/radeon/r100.c:1425: warning: Excess function parameter 
> 'parser' description in 'r100_cs_packet_parse_vline'
>
> 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 fixup. Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/r100.c | 7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
> index 24c8db673931a..92075dedf2cb2 100644
> --- a/drivers/gpu/drm/radeon/r100.c
> +++ b/drivers/gpu/drm/radeon/r100.c
> @@ -153,6 +153,7 @@ void r100_wait_for_vblank(struct radeon_device *rdev, int 
> crtc)
>   * @rdev: radeon_device pointer
>   * @crtc_id: crtc to cleanup pageflip on
>   * @crtc_base: new address of the crtc (GPU MC address)
> + * @async: unused
>   *
>   * Does the actual pageflip (r1xx-r4xx).
>   * During vblank we take the crtc lock and wait for the update_pending
> @@ -841,8 +842,8 @@ u32 r100_get_vblank_counter(struct radeon_device *rdev, 
> int crtc)
>
>  /**
>   * r100_ring_hdp_flush - flush Host Data Path via the ring buffer
> - * rdev: radeon device structure
> - * ring: ring buffer struct for emitting packets
> + * @rdev: radeon device structure
> + * @ring: ring buffer struct for emitting packets
>   */
>  static void r100_ring_hdp_flush(struct radeon_device *rdev, struct 
> radeon_ring *ring)
>  {
> @@ -1409,7 +1410,7 @@ int r100_cs_parse_packet0(struct radeon_cs_parser *p,
>
>  /**
>   * r100_cs_packet_next_vline() - parse userspace VLINE packet
> - * @parser:parser structure holding parsing context.
> + * @p: parser structure holding parsing context.
>   *
>   * Userspace sends a special sequence for VLINE waits.
>   * PACKET0 - VLINE_START_END + value
> --
> 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/30] drm/radeon/radeon_mn: Supply description for 'cur_seq' even if it is unused

2020-11-10 Thread Alex Deucher
On Tue, Nov 10, 2020 at 2:31 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_mn.c:51: warning: Function parameter or member 
> 'cur_seq' not described in 'radeon_mn_invalidate'
>
> 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 fixup.  Thanks!

Alex


> ---
>  drivers/gpu/drm/radeon/radeon_mn.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_mn.c 
> b/drivers/gpu/drm/radeon/radeon_mn.c
> index 97b9b6dd6dd3b..3c4c4213a7b57 100644
> --- a/drivers/gpu/drm/radeon/radeon_mn.c
> +++ b/drivers/gpu/drm/radeon/radeon_mn.c
> @@ -41,6 +41,7 @@
>   *
>   * @mn: our notifier
>   * @range: the VMA under invalidation
> + * @cur_seq: unused
>   *
>   * We block for all BOs between start and end to be idle and
>   * unmap them by move them into system domain again.
> --
> 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 08/30] drm/radeon/ci_dpm: Remove set but unused variable 'dpm_event_src'

2020-11-10 Thread Alex Deucher
On Tue, Nov 10, 2020 at 2:31 PM Lee Jones  wrote:
>
> And the piece of code that has never been executed.
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/ci_dpm.c: In function ‘ci_set_dpm_event_sources’:
>  drivers/gpu/drm/radeon/ci_dpm.c:1369:28: warning: variable ‘dpm_event_src’ 
> set but not used [-Wunused-but-set-variable]
>
> 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 | 12 
>  1 file changed, 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c
> index 886e9959496fe..8324aca5fd006 100644
> --- a/drivers/gpu/drm/radeon/ci_dpm.c
> +++ b/drivers/gpu/drm/radeon/ci_dpm.c
> @@ -1366,7 +1366,6 @@ static void ci_set_dpm_event_sources(struct 
> radeon_device *rdev, u32 sources)
>  {
> struct ci_power_info *pi = ci_get_pi(rdev);
> bool want_thermal_protection;
> -   enum radeon_dpm_event_src dpm_event_src;
> u32 tmp;
>
> switch (sources) {
> @@ -1376,28 +1375,17 @@ static void ci_set_dpm_event_sources(struct 
> radeon_device *rdev, u32 sources)
> break;
> case (1 << RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL):
> want_thermal_protection = true;
> -   dpm_event_src = RADEON_DPM_EVENT_SRC_DIGITAL;
> break;
> case (1 << RADEON_DPM_AUTO_THROTTLE_SRC_EXTERNAL):
> want_thermal_protection = true;
> -   dpm_event_src = RADEON_DPM_EVENT_SRC_EXTERNAL;
> break;
> case ((1 << RADEON_DPM_AUTO_THROTTLE_SRC_EXTERNAL) |
>   (1 << RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL)):
> want_thermal_protection = true;
> -   dpm_event_src = RADEON_DPM_EVENT_SRC_DIGIAL_OR_EXTERNAL;
> break;
> }
>
> if (want_thermal_protection) {
> -#if 0
> -   /* XXX: need to figure out how to handle this properly */
> -   tmp = RREG32_SMC(CG_THERMAL_CTRL);
> -   tmp &= DPM_EVENT_SRC_MASK;
> -   tmp |= DPM_EVENT_SRC(dpm_event_src);
> -   WREG32_SMC(CG_THERMAL_CTRL, tmp);
> -#endif
> -
> tmp = RREG32_SMC(GENERAL_PWRMGT);
> if (pi->thermal_protection)
> tmp &= ~THERMAL_PROTECTION_DIS;
> --
> 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 11/30] drm/radeon/radeon_ib: Supply description for 'radeon_ib_get's get param

2020-11-10 Thread Alex Deucher
On Tue, Nov 10, 2020 at 2:31 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_ib.c:61: warning: Function parameter or member 
> 'vm' not described in 'radeon_ib_get'
>
> 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_ib.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_ib.c 
> b/drivers/gpu/drm/radeon/radeon_ib.c
> index 9fd55e9c616b0..c1fca2ba443c9 100644
> --- a/drivers/gpu/drm/radeon/radeon_ib.c
> +++ b/drivers/gpu/drm/radeon/radeon_ib.c
> @@ -48,6 +48,7 @@ static int radeon_debugfs_sa_init(struct radeon_device 
> *rdev);
>   *
>   * @rdev: radeon_device pointer
>   * @ring: ring index the IB is associated with
> + * @vm: requested vm
>   * @ib: IB object returned
>   * @size: requested IB size
>   *
> --
> 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 10/30] drm/radeon/radeon_sync: Add description for function param 'rdev'

2020-11-10 Thread Alex Deucher
On Tue, Nov 10, 2020 at 2:31 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_sync.c:92: warning: Function parameter or 
> member 'rdev' not described in 'radeon_sync_resv'
>
> 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_sync.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_sync.c 
> b/drivers/gpu/drm/radeon/radeon_sync.c
> index 55cc77a73c7b7..5d3302945076b 100644
> --- a/drivers/gpu/drm/radeon/radeon_sync.c
> +++ b/drivers/gpu/drm/radeon/radeon_sync.c
> @@ -79,6 +79,7 @@ void radeon_sync_fence(struct radeon_sync *sync,
>  /**
>   * radeon_sync_resv - use the semaphores to sync to a reservation object
>   *
> + * @rdev: radeon_device pointer
>   * @sync: sync object to add fences from reservation object to
>   * @resv: reservation object with embedded fence
>   * @shared: true if we should only sync to the exclusive fence
> --
> 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/30] drm/radeon/radeon_dp_mst: Remove unused variable 'ret' from radeon_mst_encoder_dpms()

2020-11-10 Thread Alex Deucher
On Tue, Nov 10, 2020 at 2:31 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_dp_mst.c: In function 
> ‘radeon_mst_encoder_dpms’:
>  drivers/gpu/drm/radeon/radeon_dp_mst.c:366:6: warning: variable ‘ret’ set 
> but not used [-Wunused-but-set-variable]
>
> 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_dp_mst.c | 16 
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_dp_mst.c 
> b/drivers/gpu/drm/radeon/radeon_dp_mst.c
> index 008308780443c..2c32186c4acd9 100644
> --- a/drivers/gpu/drm/radeon/radeon_dp_mst.c
> +++ b/drivers/gpu/drm/radeon/radeon_dp_mst.c
> @@ -363,7 +363,7 @@ radeon_mst_encoder_dpms(struct drm_encoder *encoder, int 
> mode)
> struct radeon_connector *radeon_connector;
> struct drm_crtc *crtc;
> struct radeon_crtc *radeon_crtc;
> -   int ret, slots;
> +   int slots;
> s64 fixed_pbn, fixed_pbn_per_slot, avg_time_slots_per_mtp;
> if (!ASIC_IS_DCE5(rdev)) {
> DRM_ERROR("got mst dpms on non-DCE5\n");
> @@ -418,10 +418,10 @@ radeon_mst_encoder_dpms(struct drm_encoder *encoder, 
> int mode)
>
> slots = 
> drm_dp_find_vcpi_slots(_connector->mst_port->mst_mgr,
>mst_enc->pbn);
> -   ret = 
> drm_dp_mst_allocate_vcpi(_connector->mst_port->mst_mgr,
> -  radeon_connector->port,
> -  mst_enc->pbn, slots);
> -   ret = 
> drm_dp_update_payload_part1(_connector->mst_port->mst_mgr);
> +   drm_dp_mst_allocate_vcpi(_connector->mst_port->mst_mgr,
> +radeon_connector->port,
> +mst_enc->pbn, slots);
> +   
> drm_dp_update_payload_part1(_connector->mst_port->mst_mgr);
>
> radeon_dp_mst_set_be_cntl(primary, mst_enc,
>   
> radeon_connector->mst_port->hpd.hpd, true);
> @@ -436,9 +436,9 @@ radeon_mst_encoder_dpms(struct drm_encoder *encoder, int 
> mode)
>
> atombios_dig_encoder_setup2(>base, 
> ATOM_ENCODER_CMD_DP_VIDEO_ON, 0,
> mst_enc->fe);
> -   ret = 
> drm_dp_check_act_status(_connector->mst_port->mst_mgr);
> +   drm_dp_check_act_status(_connector->mst_port->mst_mgr);
>
> -   ret = 
> drm_dp_update_payload_part2(_connector->mst_port->mst_mgr);
> +   
> drm_dp_update_payload_part2(_connector->mst_port->mst_mgr);
>
> break;
> case DRM_MODE_DPMS_STANDBY:
> @@ -450,7 +450,7 @@ radeon_mst_encoder_dpms(struct drm_encoder *encoder, int 
> mode)
> return;
>
> 
> drm_dp_mst_reset_vcpi_slots(_connector->mst_port->mst_mgr, 
> mst_enc->port);
> -   ret = 
> drm_dp_update_payload_part1(_connector->mst_port->mst_mgr);
> +   
> drm_dp_update_payload_part1(_connector->mst_port->mst_mgr);
>
> drm_dp_check_act_status(_connector->mst_port->mst_mgr);
> /* and this can also fail */
> --
> 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/30] drm/radeon/trinity_dpm: Remove some defined but never used arrays

2020-11-10 Thread Alex Deucher
On Tue, Nov 10, 2020 at 2:31 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/trinity_dpm.c:146:18: warning: 
> ‘trinity_sysls_default’ defined but not used [-Wunused-const-variable=]
>  drivers/gpu/drm/radeon/trinity_dpm.c:131:18: warning: 
> ‘trinity_mgcg_shls_disable’ defined but not used [-Wunused-const-variable=]
>  drivers/gpu/drm/radeon/trinity_dpm.c:120:18: warning: 
> ‘trinity_mgcg_shls_enable’ defined but not used [-Wunused-const-variable=]
>
> 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/trinity_dpm.c | 44 
>  1 file changed, 44 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/trinity_dpm.c 
> b/drivers/gpu/drm/radeon/trinity_dpm.c
> index 4d93b84aa7397..e005c18aac00e 100644
> --- a/drivers/gpu/drm/radeon/trinity_dpm.c
> +++ b/drivers/gpu/drm/radeon/trinity_dpm.c
> @@ -116,55 +116,11 @@ static const u32 trinity_mgcg_shls_default[] =
> 0x9220, 0x00090008, 0x,
> 0x9294, 0x, 0x
>  };
> -
> -static const u32 trinity_mgcg_shls_enable[] =
> -{
> -   /* Register, Value, Mask */
> -   0x802c, 0xc000, 0x,
> -   0x08f8, 0x, 0x,
> -   0x08fc, 0x, 0x000133FF,
> -   0x08f8, 0x0001, 0x,
> -   0x08fc, 0x, 0xE00B03FC,
> -   0x9150, 0x96944200, 0x
> -};
> -
> -static const u32 trinity_mgcg_shls_disable[] =
> -{
> -   /* Register, Value, Mask */
> -   0x802c, 0xc000, 0x,
> -   0x9150, 0x0060, 0x,
> -   0x08f8, 0x, 0x,
> -   0x08fc, 0x, 0x000133FF,
> -   0x08f8, 0x0001, 0x,
> -   0x08fc, 0x, 0xE00B03FC
> -};
>  #endif
>
>  #ifndef TRINITY_SYSLS_SEQUENCE
>  #define TRINITY_SYSLS_SEQUENCE  100
>
> -static const u32 trinity_sysls_default[] =
> -{
> -   /* Register, Value, Mask */
> -   0x55e8, 0x, 0x,
> -   0xd0bc, 0x, 0x,
> -   0xd8bc, 0x, 0x,
> -   0x15c0, 0x000c1401, 0x,
> -   0x264c, 0x000c0400, 0x,
> -   0x2648, 0x000c0400, 0x,
> -   0x2650, 0x000c0400, 0x,
> -   0x20b8, 0x000c0400, 0x,
> -   0x20bc, 0x000c0400, 0x,
> -   0x20c0, 0x000c0c80, 0x,
> -   0xf4a0, 0x00c0, 0x,
> -   0xf4a4, 0x00680fff, 0x,
> -   0x2f50, 0x0404, 0x,
> -   0x04c8, 0x0001, 0x,
> -   0x641c, 0x, 0x,
> -   0x0c7c, 0x, 0x,
> -   0x6dfc, 0x, 0x
> -};
> -
>  static const u32 trinity_sysls_disable[] =
>  {
> /* Register, Value, Mask */
> --
> 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/30] drm/radeon/kv_dpm: Strip out unused functions and their tables

2020-11-10 Thread Alex Deucher
On Tue, Nov 10, 2020 at 2:31 PM Lee Jones  wrote:
>
> These haven't been used since the driver was upstreamed in 2013.
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/kv_dpm.c:161:40: warning: ‘cpl_cac_config_reg’ 
> defined but not used [-Wunused-const-variable=]
>  drivers/gpu/drm/radeon/kv_dpm.c:156:40: warning: ‘mc3_cac_config_reg’ 
> defined but not used [-Wunused-const-variable=]
>  drivers/gpu/drm/radeon/kv_dpm.c:151:40: warning: ‘mc2_cac_config_reg’ 
> defined but not used [-Wunused-const-variable=]
>  drivers/gpu/drm/radeon/kv_dpm.c:146:40: warning: ‘mc1_cac_config_reg’ 
> defined but not used [-Wunused-const-variable=]
>  drivers/gpu/drm/radeon/kv_dpm.c:141:40: warning: ‘mc0_cac_config_reg’ 
> defined but not used [-Wunused-const-variable=]
>  drivers/gpu/drm/radeon/kv_dpm.c:136:40: warning: ‘sx0_cac_config_reg’ 
> defined but not used [-Wunused-const-variable=]
>  drivers/gpu/drm/radeon/kv_dpm.c:104:43: warning: ‘cpl_local_cac_cfg_kv’ 
> defined but not used [-Wunused-const-variable=]
>  drivers/gpu/drm/radeon/kv_dpm.c:98:43: warning: ‘mc3_local_cac_cfg_kv’ 
> defined but not used [-Wunused-const-variable=]
>  drivers/gpu/drm/radeon/kv_dpm.c:92:43: warning: ‘mc2_local_cac_cfg_kv’ 
> defined but not used [-Wunused-const-variable=]
>  drivers/gpu/drm/radeon/kv_dpm.c:86:43: warning: ‘mc1_local_cac_cfg_kv’ 
> defined but not used [-Wunused-const-variable=]
>  drivers/gpu/drm/radeon/kv_dpm.c:80:43: warning: ‘mc0_local_cac_cfg_kv’ 
> defined but not used [-Wunused-const-variable=]
>  drivers/gpu/drm/radeon/kv_dpm.c:67:43: warning: ‘sx_local_cac_cfg_kv’ 
> defined but not used [-Wunused-const-variable=]
>
> 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/kv_dpm.c | 205 +---
>  1 file changed, 1 insertion(+), 204 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/kv_dpm.c b/drivers/gpu/drm/radeon/kv_dpm.c
> index 5e6086eb18073..f7735da07feb9 100644
> --- a/drivers/gpu/drm/radeon/kv_dpm.c
> +++ b/drivers/gpu/drm/radeon/kv_dpm.c
> @@ -64,105 +64,6 @@ extern void cik_exit_rlc_safe_mode(struct radeon_device 
> *rdev);
>  extern void cik_update_cg(struct radeon_device *rdev,
>   u32 block, bool enable);
>
> -static const struct kv_lcac_config_values sx_local_cac_cfg_kv[] =
> -{
> -   {  0,   4,1},
> -   {  1,   4,1},
> -   {  2,   5,1},
> -   {  3,   4,2},
> -   {  4,   1,1},
> -   {  5,   5,2},
> -   {  6,   6,1},
> -   {  7,   9,2},
> -   { 0x }
> -};
> -
> -static const struct kv_lcac_config_values mc0_local_cac_cfg_kv[] =
> -{
> -   {  0,   4,1},
> -   { 0x }
> -};
> -
> -static const struct kv_lcac_config_values mc1_local_cac_cfg_kv[] =
> -{
> -   {  0,   4,1},
> -   { 0x }
> -};
> -
> -static const struct kv_lcac_config_values mc2_local_cac_cfg_kv[] =
> -{
> -   {  0,   4,1},
> -   { 0x }
> -};
> -
> -static const struct kv_lcac_config_values mc3_local_cac_cfg_kv[] =
> -{
> -   {  0,   4,1},
> -   { 0x }
> -};
> -
> -static const struct kv_lcac_config_values cpl_local_cac_cfg_kv[] =
> -{
> -   {  0,   4,1},
> -   {  1,   4,1},
> -   {  2,   5,1},
> -   {  3,   4,1},
> -   {  4,   1,1},
> -   {  5,   5,1},
> -   {  6,   6,1},
> -   {  7,   9,1},
> -   {  8,   4,1},
> -   {  9,   2,1},
> -   {  10,  3,1},
> -   {  11,  6,1},
> -   {  12,  8,2},
> -   {  13,  1,1},
> -   {  14,  2,1},
> -   {  15,  3,1},
> -   {  16,  1,1},
> -   {  17,  4,1},
> -   {  18,  3,1},
> -   {  19,  1,1},
> -   {  20,  8,1},
> -   {  21,  5,1},
> -   {  22,  1,1},
> -   {  23,  1,1},
> -   {  24,  4,1},
> -   {  27,  6,1},
> -   {  28,  1,1},
> -   { 0x }
> -};
> -
> -static const struct kv_lcac_config_reg sx0_cac_config_reg[] =
> -{
> -   { 0xc0400d00, 0x003e, 17, 0x3fc0, 22, 0x0001fffe, 1, 
> 0x0001, 0 }
> -};
> -
> -static const struct kv_lcac_config_reg mc0_cac_config_reg[] =
> -{
> -   { 0xc0400d30, 0x003e, 17, 0x3fc0, 22, 0x0001fffe, 1, 
> 0x0001, 0 }
> -};
> -
> -static const 

Re: [PATCH 09/30] drm/radeon/radeon_vm: Fix some function parameter documentation

2020-11-10 Thread Alex Deucher
On Tue, Nov 10, 2020 at 2:31 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_vm.c:131: warning: Function parameter or 
> member 'rdev' not described in 'radeon_vm_get_bos'
>  drivers/gpu/drm/radeon/radeon_vm.c:643: warning: Excess function parameter 
> 'start' description in 'radeon_vm_update_page_directory'
>  drivers/gpu/drm/radeon/radeon_vm.c:643: warning: Excess function parameter 
> 'end' description in 'radeon_vm_update_page_directory'
>  drivers/gpu/drm/radeon/radeon_vm.c:819: warning: Function parameter or 
> member 'ib' not described in 'radeon_vm_update_ptes'
>  drivers/gpu/drm/radeon/radeon_vm.c:915: warning: Function parameter or 
> member 'bo_va' not described in 'radeon_vm_bo_update'
>  drivers/gpu/drm/radeon/radeon_vm.c:915: warning: Excess function parameter 
> 'vm' description in 'radeon_vm_bo_update'
>  drivers/gpu/drm/radeon/radeon_vm.c:915: warning: Excess function parameter 
> 'bo' description in 'radeon_vm_bo_update'
>  drivers/gpu/drm/radeon/radeon_vm.c:1155: warning: Excess function parameter 
> 'vm' description in 'radeon_vm_bo_invalidate'
>
> 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 a small fixup.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/radeon_vm.c | 8 +++-
>  1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_vm.c 
> b/drivers/gpu/drm/radeon/radeon_vm.c
> index 27b14eff532cb..71f2edcac6ea0 100644
> --- a/drivers/gpu/drm/radeon/radeon_vm.c
> +++ b/drivers/gpu/drm/radeon/radeon_vm.c
> @@ -119,6 +119,7 @@ void radeon_vm_manager_fini(struct radeon_device *rdev)
>  /**
>   * radeon_vm_get_bos - add the vm BOs to a validation list
>   *
> + * @rdev: radeon_device pointer
>   * @vm: vm providing the BOs
>   * @head: head of validation list
>   *
> @@ -629,8 +630,6 @@ static uint32_t radeon_vm_page_flags(uint32_t flags)
>   *
>   * @rdev: radeon_device pointer
>   * @vm: requested vm
> - * @start: start of GPU address range
> - * @end: end of GPU address range
>   *
>   * Allocates new page tables if necessary
>   * and updates the page directory (cayman+).
> @@ -802,6 +801,7 @@ static void radeon_vm_frag_ptes(struct radeon_device 
> *rdev,
>   *
>   * @rdev: radeon_device pointer
>   * @vm: requested vm
> + * @ib: indirect buffer to use for the update
>   * @start: start of GPU address range
>   * @end: end of GPU address range
>   * @dst: destination address to map to
> @@ -900,8 +900,7 @@ static void radeon_vm_fence_pts(struct radeon_vm *vm,
>   * radeon_vm_bo_update - map a bo into the vm page table
>   *
>   * @rdev: radeon_device pointer
> - * @vm: requested vm
> - * @bo: radeon buffer object
> + * @bo_va: radeon buffer object
>   * @mem: ttm mem
>   *
>   * Fill in the page table entries for @bo (cayman+).
> @@ -1145,7 +1144,6 @@ void radeon_vm_bo_rmv(struct radeon_device *rdev,
>   * radeon_vm_bo_invalidate - mark the bo as invalid
>   *
>   * @rdev: radeon_device pointer
> - * @vm: requested vm
>   * @bo: radeon buffer object
>   *
>   * Mark @bo as invalid (cayman+).
> --
> 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/30] drm/radeon/cik: Remove set but unused variable 'mc_shared_chmap'

2020-11-10 Thread Alex Deucher
On Tue, Nov 10, 2020 at 2:31 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/cik.c: In function ‘cik_gpu_init’:
>  drivers/gpu/drm/radeon/cik.c:3180:6: warning: variable ‘mc_shared_chmap’ set 
> but not used [-Wunused-but-set-variable]
>
> 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 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
> index 4494f9122fd91..b94e2e678f255 100644
> --- a/drivers/gpu/drm/radeon/cik.c
> +++ b/drivers/gpu/drm/radeon/cik.c
> @@ -3177,7 +3177,7 @@ static void cik_setup_rb(struct radeon_device *rdev,
>  static void cik_gpu_init(struct radeon_device *rdev)
>  {
> u32 gb_addr_config = RREG32(GB_ADDR_CONFIG);
> -   u32 mc_shared_chmap, mc_arb_ramcfg;
> +   u32 mc_arb_ramcfg;
> u32 hdp_host_path_cntl;
> u32 tmp;
> int i, j;
> @@ -3270,7 +3270,7 @@ static void cik_gpu_init(struct radeon_device *rdev)
>
> WREG32(BIF_FB_EN, FB_READ_EN | FB_WRITE_EN);
>
> -   mc_shared_chmap = RREG32(MC_SHARED_CHMAP);
> +   RREG32(MC_SHARED_CHMAP);
> mc_arb_ramcfg = RREG32(MC_ARB_RAMCFG);
>
> rdev->config.cik.num_tile_pipes = rdev->config.cik.max_tile_pipes;
> --
> 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/30] drm/radeon/ni: Demote vague attempt at function header doc

2020-11-10 Thread Alex Deucher
On Tue, Nov 10, 2020 at 2:31 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/ni.c: In function ‘cayman_gpu_init’:
>  drivers/gpu/drm/radeon/ni.c:2679: warning: Function parameter or member 
> 'ring' not described in 'cayman_vm_flush'
>  drivers/gpu/drm/radeon/ni.c:2679: warning: Function parameter or member 
> 'vm_id' not described in 'cayman_vm_flush'
>  drivers/gpu/drm/radeon/ni.c:2679: warning: Function parameter or member 
> 'pd_addr' not described in 'cayman_vm_flush'
>
> 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.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
> index 53a4d5c109794..12dd082069649 100644
> --- a/drivers/gpu/drm/radeon/ni.c
> +++ b/drivers/gpu/drm/radeon/ni.c
> @@ -2668,11 +2668,9 @@ void cayman_vm_decode_fault(struct radeon_device *rdev,
>block, mc_id);
>  }
>
> -/**
> +/*
>   * cayman_vm_flush - vm flush using the CP
>   *
> - * @rdev: radeon_device pointer
> - *
>   * Update the page table base and flush the VM TLB
>   * using the CP (cayman-si).
>   */
> --
> 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/30] drm/radeon/si: Remove set but unused variable 'mc_shared_chmap'

2020-11-10 Thread Alex Deucher
On Tue, Nov 10, 2020 at 2:31 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/si.c: In function ‘si_gpu_init’:
>  drivers/gpu/drm/radeon/si.c:3090:6: warning: variable ‘mc_shared_chmap’ set 
> but not used [-Wunused-but-set-variable]
>
> 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 | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
> index c27af89785f34..45076c27d7ded 100644
> --- a/drivers/gpu/drm/radeon/si.c
> +++ b/drivers/gpu/drm/radeon/si.c
> @@ -3088,7 +3088,7 @@ static void si_setup_rb(struct radeon_device *rdev,
>  static void si_gpu_init(struct radeon_device *rdev)
>  {
> u32 gb_addr_config = 0;
> -   u32 mc_shared_chmap, mc_arb_ramcfg;
> +   u32 mc_arb_ramcfg;
> u32 sx_debug_1;
> u32 hdp_host_path_cntl;
> u32 tmp;
> @@ -3200,7 +3200,7 @@ static void si_gpu_init(struct radeon_device *rdev)
>
> WREG32(BIF_FB_EN, FB_READ_EN | FB_WRITE_EN);
>
> -   mc_shared_chmap = RREG32(MC_SHARED_CHMAP);
> +   RREG32(MC_SHARED_CHMAP);
> mc_arb_ramcfg = RREG32(MC_ARB_RAMCFG);
>
> rdev->config.si.num_tile_pipes = rdev->config.si.max_tile_pipes;
> --
> 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/30] drm/radeon/evergreen: Add comment for 'evergreen_page_flip()'s 'async' param

2020-11-10 Thread Alex Deucher
On Tue, Nov 10, 2020 at 2:31 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/evergreen.c: In function ‘evergreen_gpu_init’:
>  drivers/gpu/drm/radeon/evergreen.c:1419: warning: Function parameter or 
> member 'async' not described in 'evergreen_page_flip'
>
> 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 fixups.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/evergreen.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/radeon/evergreen.c 
> b/drivers/gpu/drm/radeon/evergreen.c
> index 4eb3f9bc8fa8b..c9a9a87959f9e 100644
> --- a/drivers/gpu/drm/radeon/evergreen.c
> +++ b/drivers/gpu/drm/radeon/evergreen.c
> @@ -1412,6 +1412,7 @@ void dce4_wait_for_vblank(struct radeon_device *rdev, 
> int crtc)
>   * @rdev: radeon_device pointer
>   * @crtc_id: crtc to cleanup pageflip on
>   * @crtc_base: new address of the crtc (GPU MC address)
> + * @async: Set retrace
>   *
>   * Triggers the actual pageflip by updating the primary
>   * surface base address (evergreen+).
> --
> 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/30] drm/radeon/evergreen: Remove set but unused variable 'mc_shared_chmap'

2020-11-10 Thread Alex Deucher
On Tue, Nov 10, 2020 at 2:31 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/evergreen.c: In function ‘evergreen_gpu_init’:
>  drivers/gpu/drm/radeon/evergreen.c:3135:6: warning: variable 
> ‘mc_shared_chmap’ set but not used [-Wunused-but-set-variable]
>
> 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 | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/evergreen.c 
> b/drivers/gpu/drm/radeon/evergreen.c
> index c9a9a87959f9e..efb19c445e48f 100644
> --- a/drivers/gpu/drm/radeon/evergreen.c
> +++ b/drivers/gpu/drm/radeon/evergreen.c
> @@ -3135,7 +3135,7 @@ static int evergreen_cp_resume(struct radeon_device 
> *rdev)
>  static void evergreen_gpu_init(struct radeon_device *rdev)
>  {
> u32 gb_addr_config;
> -   u32 mc_shared_chmap, mc_arb_ramcfg;
> +   u32 mc_arb_ramcfg;
> u32 sx_debug_1;
> u32 smx_dc_ctl0;
> u32 sq_config;
> @@ -3399,7 +3399,7 @@ static void evergreen_gpu_init(struct radeon_device 
> *rdev)
>
> evergreen_fix_pci_max_read_req_size(rdev);
>
> -   mc_shared_chmap = RREG32(MC_SHARED_CHMAP);
> +   RREG32(MC_SHARED_CHMAP);
> if ((rdev->family == CHIP_PALM) ||
> (rdev->family == CHIP_SUMO) ||
> (rdev->family == CHIP_SUMO2))
> --
> 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/20] drm/radeon/cik: Fix a bunch of function parameter descriptions

2020-11-10 Thread Alex Deucher
On Mon, Nov 9, 2020 at 4:19 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/cik.c:1869:5: warning: no previous prototype for 
> ‘ci_mc_load_microcode’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/cik.c: In function ‘cik_gpu_init’:
>  drivers/gpu/drm/radeon/cik.c:3181:6: warning: variable ‘mc_shared_chmap’ set 
> but not used [-Wunused-but-set-variable]
>  drivers/gpu/drm/radeon/cik.c: At top level:
>  drivers/gpu/drm/radeon/cik.c:4852:5: warning: no previous prototype for 
> ‘cik_gpu_check_soft_reset’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/cik.c:5850:6: warning: no previous prototype for 
> ‘cik_enter_rlc_safe_mode’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/cik.c:5871:6: warning: no previous prototype for 
> ‘cik_exit_rlc_safe_mode’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/cik.c:6289:6: warning: no previous prototype for 
> ‘cik_update_cg’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/cik.c:6421:6: warning: no previous prototype for 
> ‘cik_init_cp_pg_table’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/cik.c:6678:5: warning: no previous prototype for 
> ‘cik_get_csb_size’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/cik.c:6710:6: warning: no previous prototype for 
> ‘cik_get_csb_buffer’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/cik.c:3084: warning: Function parameter or member 
> 'max_rb_num_per_se' not described in 'cik_get_rb_disabled'
>  drivers/gpu/drm/radeon/cik.c:3084: warning: Excess function parameter 
> 'max_rb_num' description in 'cik_get_rb_disabled'
>  drivers/gpu/drm/radeon/cik.c:3084: warning: Excess function parameter 
> 'se_num' description in 'cik_get_rb_disabled'
>  drivers/gpu/drm/radeon/cik.c:3114: warning: Function parameter or member 
> 'max_rb_num_per_se' not described in 'cik_setup_rb'
>  drivers/gpu/drm/radeon/cik.c:3114: warning: Excess function parameter 
> 'max_rb_num' description in 'cik_setup_rb'
>  drivers/gpu/drm/radeon/cik.c:5662: warning: Function parameter or member 
> 'mc_client' not described in 'cik_vm_decode_fault'
>  drivers/gpu/drm/radeon/cik.c:5690: warning: Function parameter or member 
> 'ring' not described in 'cik_vm_flush'
>  drivers/gpu/drm/radeon/cik.c:5690: warning: Function parameter or member 
> 'vm_id' not described in 'cik_vm_flush'
>  drivers/gpu/drm/radeon/cik.c:5690: warning: Function parameter or member 
> 'pd_addr' not described in 'cik_vm_flush'
>
> 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 fixups.  Thanks!

Alex


> ---
>  drivers/gpu/drm/radeon/cik.c | 10 --
>  1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
> index 5c42877fd6fbf..4494f9122fd91 100644
> --- a/drivers/gpu/drm/radeon/cik.c
> +++ b/drivers/gpu/drm/radeon/cik.c
> @@ -3071,8 +3071,7 @@ static u32 cik_create_bitmask(u32 bit_width)
>   * cik_get_rb_disabled - computes the mask of disabled RBs
>   *
>   * @rdev: radeon_device pointer
> - * @max_rb_num: max RBs (render backends) for the asic
> - * @se_num: number of SEs (shader engines) for the asic
> + * @max_rb_num_per_se: max RBs (render backends) for the asic
>   * @sh_per_se: number of SH blocks per SE for the asic
>   *
>   * Calculates the bitmask of disabled RBs (CIK).
> @@ -3104,7 +3103,7 @@ static u32 cik_get_rb_disabled(struct radeon_device 
> *rdev,
>   * @rdev: radeon_device pointer
>   * @se_num: number of SEs (shader engines) for the asic
>   * @sh_per_se: number of SH blocks per SE for the asic
> - * @max_rb_num: max RBs (render backends) for the asic
> + * @max_rb_num_per_se: max RBs (render backends) for the asic
>   *
>   * Configures per-SE/SH RB registers (CIK).
>   */
> @@ -5654,6 +5653,7 @@ void cik_vm_fini(struct radeon_device *rdev)
>   * @rdev: radeon_device pointer
>   * @status: VM_CONTEXT1_PROTECTION_FAULT_STATUS register value
>   * @addr: VM_CONTEXT1_PROTECTION_FAULT_ADDR register value
> + * @mc_client: VM_CONTEXT1_PROTECTION_FAULT_MCCLIENT register value
>   *
>   * Print human readable fault information (CIK).
>   */
> @@ -5677,11 +5677,9 @@ static void cik_vm_decode_fault(struct radeon_device 
> *rdev,
>block, mc_client, mc_id);
>  }
>
> -/**
> +/*
>   * cik_vm_flush - cik vm flush using the CP
>   *
> - * @rdev: radeon_device pointer
> - *
>   * Update the page table base and flush the VM TLB
>   * using the CP (CIK).
>   */
> --
> 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

Re: [PATCH 19/20] drm/radeon/r600: Fix a misnamed parameter description and a formatting issue

2020-11-10 Thread Alex Deucher
On Mon, Nov 9, 2020 at 4:19 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/r600.c:2965: warning: Function parameter or member 
> 'resv' not described in 'r600_copy_cpdma'
>  drivers/gpu/drm/radeon/r600.c:2965: warning: Excess function parameter 
> 'fence' description in 'r600_copy_cpdma'
>  drivers/gpu/drm/radeon/r600.c:4382: warning: Function parameter or member 
> 'rdev' not described in 'r600_mmio_hdp_flush'
>
> 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/r600.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
> index 9587792503525..0a085b85f559d 100644
> --- a/drivers/gpu/drm/radeon/r600.c
> +++ b/drivers/gpu/drm/radeon/r600.c
> @@ -2952,7 +2952,7 @@ bool r600_semaphore_ring_emit(struct radeon_device 
> *rdev,
>   * @src_offset: src GPU address
>   * @dst_offset: dst GPU address
>   * @num_gpu_pages: number of GPU pages to xfer
> - * @fence: radeon fence object
> + * @resv: DMA reservation object to manage fences
>   *
>   * Copy GPU paging using the CP DMA engine (r6xx+).
>   * Used by the radeon ttm implementation to move pages if
> @@ -4371,7 +4371,7 @@ int r600_debugfs_mc_info_init(struct radeon_device 
> *rdev)
>
>  /**
>   * r600_mmio_hdp_flush - flush Host Data Path cache via MMIO
> - * rdev: radeon device structure
> + * @rdev: radeon device structure
>   *
>   * Some R6XX/R7XX don't seem to take into account HDP flushes performed
>   * through the ring buffer. This leads to corruption in rendering, see
> --
> 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 18/20] drm/radeon/radeon_display: Fix function doc formatting and missing param issues

2020-11-10 Thread Alex Deucher
On Mon, Nov 9, 2020 at 4:19 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_display.c:264: warning: Function parameter or 
> member '__work' not described in 'radeon_unpin_work_func'
>  drivers/gpu/drm/radeon/radeon_display.c:406: warning: Function parameter or 
> member '__work' not described in 'radeon_flip_work_func'
>  drivers/gpu/drm/radeon/radeon_display.c:956: warning: Function parameter or 
> member 'freq' not described in 'radeon_compute_pll_avivo'
>  drivers/gpu/drm/radeon/radeon_display.c:956: warning: Function parameter or 
> member 'fb_div_p' not described in 'radeon_compute_pll_avivo'
>  drivers/gpu/drm/radeon/radeon_display.c:956: warning: Function parameter or 
> member 'frac_fb_div_p' not described in 'radeon_compute_pll_avivo'
>  drivers/gpu/drm/radeon/radeon_display.c:956: warning: Function parameter or 
> member 'ref_div_p' not described in 'radeon_compute_pll_avivo'
>  drivers/gpu/drm/radeon/radeon_display.c:956: warning: Function parameter or 
> member 'post_div_p' not described in 'radeon_compute_pll_avivo'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: report to 
> 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 | 13 +++--
>  1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_display.c 
> b/drivers/gpu/drm/radeon/radeon_display.c
> index 78fceedfd9255..eb0d4cb95f0a6 100644
> --- a/drivers/gpu/drm/radeon/radeon_display.c
> +++ b/drivers/gpu/drm/radeon/radeon_display.c
> @@ -256,7 +256,7 @@ static void radeon_crtc_destroy(struct drm_crtc *crtc)
>  /**
>   * radeon_unpin_work_func - unpin old buffer object
>   *
> - * @__work - kernel work item
> + * @__work: kernel work item
>   *
>   * Unpin the old frame buffer object outside of the interrupt handler
>   */
> @@ -398,7 +398,7 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, 
> int crtc_id)
>  /**
>   * radeon_flip_work_func - page flip framebuffer
>   *
> - * @work - kernel work item
> + * @__work: kernel work item
>   *
>   * Wait for the buffer object to become idle and do the actual page flip
>   */
> @@ -937,11 +937,12 @@ static void avivo_get_fb_ref_div(unsigned nom, unsigned 
> den, unsigned post_div,
>   * radeon_compute_pll_avivo - compute PLL paramaters
>   *
>   * @pll: information about the PLL
> + * @freq: target frequency
>   * @dot_clock_p: resulting pixel clock
> - * fb_div_p: resulting feedback divider
> - * frac_fb_div_p: fractional part of the feedback divider
> - * ref_div_p: resulting reference divider
> - * post_div_p: resulting reference divider
> + * @fb_div_p: resulting feedback divider
> + * @frac_fb_div_p: fractional part of the feedback divider
> + * @ref_div_p: resulting reference divider
> + * @post_div_p: resulting reference divider
>   *
>   * Try to calculate the PLL parameters to generate the given frequency:
>   * dot_clock = (ref_freq * feedback_div) / (ref_div * post_div)
> --
> 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/20] drm/radeon/radeon_cs: Fix a bunch of doc-rot issues

2020-11-10 Thread Alex Deucher
On Mon, Nov 9, 2020 at 4:19 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_cs.c:416: warning: Function parameter or 
> member 'backoff' not described in 'radeon_cs_parser_fini'
>  drivers/gpu/drm/radeon/radeon_cs.c:735: warning: Function parameter or 
> member 'p' not described in 'radeon_cs_packet_parse'
>  drivers/gpu/drm/radeon/radeon_cs.c:735: warning: Function parameter or 
> member 'idx' not described in 'radeon_cs_packet_parse'
>  drivers/gpu/drm/radeon/radeon_cs.c:735: warning: Excess function parameter 
> 'parser' description in 'radeon_cs_packet_parse'
>  drivers/gpu/drm/radeon/radeon_cs.c:844: warning: Function parameter or 
> member 'p' not described in 'radeon_cs_packet_next_reloc'
>  drivers/gpu/drm/radeon/radeon_cs.c:844: warning: Function parameter or 
> member 'cs_reloc' not described in 'radeon_cs_packet_next_reloc'
>  drivers/gpu/drm/radeon/radeon_cs.c:844: warning: Function parameter or 
> member 'nomm' not described in 'radeon_cs_packet_next_reloc'
>  drivers/gpu/drm/radeon/radeon_cs.c:844: warning: Excess function parameter 
> 'parser' description in 'radeon_cs_packet_next_reloc'
>  drivers/gpu/drm/radeon/radeon_cs.c:844: warning: Excess function parameter 
> 'data' description in 'radeon_cs_packet_next_reloc'
>  drivers/gpu/drm/radeon/radeon_cs.c:844: warning: Excess function parameter 
> 'offset_start' description in 'radeon_cs_packet_next_reloc'
>  drivers/gpu/drm/radeon/radeon_cs.c:844: warning: Excess function parameter 
> 'offset_mask' description in 'radeon_cs_packet_next_reloc'
>  drivers/gpu/drm/radeon/radeon_cs.c:844: warning: Excess function parameter 
> 'reloc' description in 'radeon_cs_packet_next_reloc'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: Jerome Glisse 
> 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 some minor fixups.

Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/radeon_cs.c | 12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_cs.c 
> b/drivers/gpu/drm/radeon/radeon_cs.c
> index 21ce2f9502c09..729939df29cc5 100644
> --- a/drivers/gpu/drm/radeon/radeon_cs.c
> +++ b/drivers/gpu/drm/radeon/radeon_cs.c
> @@ -408,6 +408,7 @@ static int cmp_size_smaller_first(void *priv, struct 
> list_head *a,
>   * cs_parser_fini() - clean parser states
>   * @parser:parser structure holding parsing context.
>   * @error: error number
> + * @backoff:   indicator to backoff the reservation
>   *
>   * If error is set than unvalidate buffer, otherwise just free memory
>   * used by parsing context.
> @@ -723,8 +724,9 @@ int radeon_cs_ioctl(struct drm_device *dev, void *data, 
> struct drm_file *filp)
>
>  /**
>   * radeon_cs_packet_parse() - parse cp packet and point ib index to next 
> packet
> - * @parser:parser structure holding parsing context.
> + * @p: parser structure holding parsing context.
>   * @pkt:   where to store packet information
> + * @idx:   packet index
>   *
>   * Assume that chunk_ib_index is properly set. Will return -EINVAL
>   * if packet is bigger than remaining ib size. or if packets is unknown.
> @@ -829,11 +831,9 @@ void radeon_cs_dump_packet(struct radeon_cs_parser *p,
>
>  /**
>   * radeon_cs_packet_next_reloc() - parse next (should be reloc) packet
> - * @parser:parser structure holding parsing context.
> - * @data:  pointer to relocation data
> - * @offset_start:  starting offset
> - * @offset_mask:   offset mask (to align start offset on)
> - * @reloc: reloc informations
> + * @p: parser structure holding parsing context.
> + * @cs_reloc:  reloc informations
> + * @nomm:  never actually used
>   *
>   * Check if next packet is relocation packet3, do bo validation and compute
>   * GPU offset using the provided start.
> --
> 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 11/20] drm/radeon/r600: Strip out set but unused 'tmp' variables

2020-11-10 Thread Alex Deucher
On Mon, Nov 9, 2020 at 4:19 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/r600.c: In function ‘r600_pcie_gart_tlb_flush’:
>  drivers/gpu/drm/radeon/r600.c:1083:7: warning: variable ‘tmp’ set but not 
> used [-Wunused-but-set-variable]
>  drivers/gpu/drm/radeon/r600.c: At top level:
>  drivers/gpu/drm/radeon/r600.c: In function ‘r600_mmio_hdp_flush’:
>  drivers/gpu/drm/radeon/r600.c:4393:7: warning: variable ‘tmp’ set but not 
> used [-Wunused-but-set-variable]
>
> 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/r600.c | 6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
> index d9a33ca768f34..6e780b0109995 100644
> --- a/drivers/gpu/drm/radeon/r600.c
> +++ b/drivers/gpu/drm/radeon/r600.c
> @@ -1080,7 +1080,6 @@ void r600_pcie_gart_tlb_flush(struct radeon_device 
> *rdev)
> if ((rdev->family >= CHIP_RV770) && (rdev->family <= CHIP_RV740) &&
> !(rdev->flags & RADEON_IS_AGP)) {
> void __iomem *ptr = (void *)rdev->gart.ptr;
> -   u32 tmp;
>
> /* r7xx hw bug.  write to HDP_DEBUG1 followed by fb read
>  * rather than write to HDP_REG_COHERENCY_FLUSH_CNTL
> @@ -1088,7 +1087,7 @@ void r600_pcie_gart_tlb_flush(struct radeon_device 
> *rdev)
>  * method for them.
>  */
> WREG32(HDP_DEBUG1, 0);
> -   tmp = readl((void __iomem *)ptr);
> +   readl((void __iomem *)ptr);
> } else
> WREG32(R_005480_HDP_MEM_COHERENCY_FLUSH_CNTL, 0x1);
>
> @@ -4390,10 +4389,9 @@ void r600_mmio_hdp_flush(struct radeon_device *rdev)
> if ((rdev->family >= CHIP_RV770) && (rdev->family <= CHIP_RV740) &&
> rdev->vram_scratch.ptr && !(rdev->flags & RADEON_IS_AGP)) {
> void __iomem *ptr = (void *)rdev->vram_scratch.ptr;
> -   u32 tmp;
>
> WREG32(HDP_DEBUG1, 0);
> -   tmp = readl((void __iomem *)ptr);
> +   readl((void __iomem *)ptr);
> } else
> WREG32(R_005480_HDP_MEM_COHERENCY_FLUSH_CNTL, 0x1);
>  }
> --
> 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 10/20] drm/radeon/radeon_ring: Add missing function parameters 'rdev' and 'data'

2020-11-10 Thread Alex Deucher
On Mon, Nov 9, 2020 at 4:19 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_ring.c:226: warning: Function parameter or 
> member 'rdev' not described in 'radeon_ring_unlock_undo'
>  drivers/gpu/drm/radeon/radeon_ring.c:240: warning: Function parameter or 
> member 'rdev' not described in 'radeon_ring_lockup_update'
>  drivers/gpu/drm/radeon/radeon_ring.c:283: warning: Function parameter or 
> member 'data' not described in 'radeon_ring_backup'
>
> 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_ring.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_ring.c 
> b/drivers/gpu/drm/radeon/radeon_ring.c
> index 37093cea24c59..c3304c977a0a5 100644
> --- a/drivers/gpu/drm/radeon/radeon_ring.c
> +++ b/drivers/gpu/drm/radeon/radeon_ring.c
> @@ -218,6 +218,7 @@ void radeon_ring_undo(struct radeon_ring *ring)
>  /**
>   * radeon_ring_unlock_undo - reset the wptr and unlock the ring
>   *
> + * @rdev:   radeon device structure
>   * @ring: radeon_ring structure holding ring information
>   *
>   * Call radeon_ring_undo() then unlock the ring (all asics).
> @@ -231,6 +232,7 @@ void radeon_ring_unlock_undo(struct radeon_device *rdev, 
> struct radeon_ring *rin
>  /**
>   * radeon_ring_lockup_update - update lockup variables
>   *
> + * @rdev:   radeon device structure
>   * @ring: radeon_ring structure holding ring information
>   *
>   * Update the last rptr value and timestamp (all asics).
> @@ -275,6 +277,7 @@ bool radeon_ring_test_lockup(struct radeon_device *rdev, 
> struct radeon_ring *rin
>   *
>   * @rdev: radeon_device pointer
>   * @ring: the ring we want to back up
> + * @data: placeholder for returned commit data
>   *
>   * Saves all unprocessed commits from a ring, returns the number of dwords 
> saved.
>   */
> --
> 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/20] drm/radeon/radeon_irq_kms: Demote non-conformant kernel-doc fix another

2020-11-10 Thread Alex Deucher
On Mon, Nov 9, 2020 at 4:19 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 
> ---
>  drivers/gpu/drm/radeon/radeon_irq_kms.c | 6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c 
> b/drivers/gpu/drm/radeon/radeon_irq_kms.c
> index b86bc88ad4308..3521084030d24 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.
> @@ -556,7 +554,7 @@ void radeon_irq_kms_disable_hpd(struct radeon_device 
> *rdev, unsigned hpd_mask)
>   * @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

The function name in the comment doesn't match the function name it is
documenting.  Care to fix that up too?

Alex

> --
> 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 08/20] drm/radeon/radeon_i2c: Remove pointless function header

2020-11-10 Thread Alex Deucher
On Mon, Nov 9, 2020 at 4:19 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_i2c.c:46: warning: Function parameter or 
> member 'radeon_connector' not described in 'radeon_ddc_probe'
>  drivers/gpu/drm/radeon/radeon_i2c.c:46: warning: Function parameter or 
> member 'use_aux' not described in 'radeon_ddc_probe'
>
> 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_i2c.c | 4 
>  1 file changed, 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_i2c.c 
> b/drivers/gpu/drm/radeon/radeon_i2c.c
> index 545e31e6cc3a9..aa61b3cb4049c 100644
> --- a/drivers/gpu/drm/radeon/radeon_i2c.c
> +++ b/drivers/gpu/drm/radeon/radeon_i2c.c
> @@ -38,10 +38,6 @@ 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);
>
> -/**
> - * radeon_ddc_probe
> - *
> - */
>  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 07/20] drm/radeon/radeon_display: Remove unused variable 'mod'

2020-11-10 Thread Alex Deucher
On Mon, Nov 9, 2020 at 4:19 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_display.c: In function ‘radeon_div’:
>  drivers/gpu/drm/radeon/radeon_display.c:1094:11: warning: variable ‘mod’ set 
> but not used [-Wunused-but-set-variable]
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: report to 
> 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 | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_display.c 
> b/drivers/gpu/drm/radeon/radeon_display.c
> index bd60f16fd0d78..78fceedfd9255 100644
> --- a/drivers/gpu/drm/radeon/radeon_display.c
> +++ b/drivers/gpu/drm/radeon/radeon_display.c
> @@ -1091,11 +1091,9 @@ void radeon_compute_pll_avivo(struct radeon_pll *pll,
>  /* pre-avivo */
>  static inline uint32_t radeon_div(uint64_t n, uint32_t d)
>  {
> -   uint64_t mod;
> -
> n += d / 2;
>
> -   mod = do_div(n, d);
> +   do_div(n, d);
> return n;
>  }
>
> --
> 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/20] drm/radeon/radeon_connectors: Strip out set but unused variable 'ret'

2020-11-10 Thread Alex Deucher
On Mon, Nov 9, 2020 at 4:19 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_connectors.c: In function 
> ‘radeon_setup_mst_connector’:
>  drivers/gpu/drm/radeon/radeon_connectors.c:2574:7: warning: variable ‘ret’ 
> set but not used [-Wunused-but-set-variable]
>
> 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_connectors.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c 
> b/drivers/gpu/drm/radeon/radeon_connectors.c
> index e308344344425..607ad5620bd99 100644
> --- a/drivers/gpu/drm/radeon/radeon_connectors.c
> +++ b/drivers/gpu/drm/radeon/radeon_connectors.c
> @@ -2571,13 +2571,11 @@ void radeon_setup_mst_connector(struct drm_device 
> *dev)
> return;
>
> list_for_each_entry(connector, >mode_config.connector_list, 
> head) {
> -   int ret;
> -
> radeon_connector = to_radeon_connector(connector);
>
> if (connector->connector_type != 
> DRM_MODE_CONNECTOR_DisplayPort)
> continue;
>
> -   ret = radeon_dp_mst_init(radeon_connector);
> +   radeon_dp_mst_init(radeon_connector);
> }
>  }
> --
> 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/20] drm/radeon/radeon_fence: Demote some non-conformant kernel-doc headers and fix another

2020-11-10 Thread Alex Deucher
On Mon, Nov 9, 2020 at 4:19 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_fence.c:168: warning: Function parameter or 
> member 'wait' not described in 'radeon_fence_check_signaled'
>  drivers/gpu/drm/radeon/radeon_fence.c:168: warning: Function parameter or 
> member 'mode' not described in 'radeon_fence_check_signaled'
>  drivers/gpu/drm/radeon/radeon_fence.c:168: warning: Function parameter or 
> member 'flags' not described in 'radeon_fence_check_signaled'
>  drivers/gpu/drm/radeon/radeon_fence.c:168: warning: Function parameter or 
> member 'key' not described in 'radeon_fence_check_signaled'
>  drivers/gpu/drm/radeon/radeon_fence.c:393: warning: Function parameter or 
> member 'f' not described in 'radeon_fence_enable_signaling'
>  drivers/gpu/drm/radeon/radeon_fence.c:393: warning: Excess function 
> parameter 'fence' description in 'radeon_fence_enable_signaling'
>  drivers/gpu/drm/radeon/radeon_fence.c:1010: warning: Function parameter or 
> member 'm' not described in 'radeon_debugfs_gpu_reset'
>  drivers/gpu/drm/radeon/radeon_fence.c:1010: warning: Function parameter or 
> member 'data' not described in 'radeon_debugfs_gpu_reset'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: Jerome Glisse 
> 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_fence.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_fence.c 
> b/drivers/gpu/drm/radeon/radeon_fence.c
> index 8735bf2bb8b5c..9ee6e599ef83b 100644
> --- a/drivers/gpu/drm/radeon/radeon_fence.c
> +++ b/drivers/gpu/drm/radeon/radeon_fence.c
> @@ -157,7 +157,7 @@ int radeon_fence_emit(struct radeon_device *rdev,
> return 0;
>  }
>
> -/**
> +/*
>   * radeon_fence_check_signaled - callback from fence_queue
>   *
>   * this function is called with fence_queue lock held, which is also used
> @@ -383,7 +383,7 @@ static bool radeon_fence_is_signaled(struct dma_fence *f)
>
>  /**
>   * radeon_fence_enable_signaling - enable signalling on fence
> - * @fence: fence
> + * @f: fence
>   *
>   * This function is called with fence_queue lock held, and adds a callback
>   * to fence_queue that checks if this fence is signaled, and if so it
> @@ -1001,7 +1001,7 @@ static int radeon_debugfs_fence_info(struct seq_file 
> *m, void *data)
> return 0;
>  }
>
> -/**
> +/*
>   * radeon_debugfs_gpu_reset - manually trigger a gpu reset
>   *
>   * Manually trigger a gpu reset at the next fence wait.
> --
> 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/20] drm/radeon/radeon_ttm: Place declaration of 'rdev' in same clause as its use

2020-11-10 Thread Alex Deucher
On Mon, Nov 9, 2020 at 4:19 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_ttm.c: In function ‘radeon_ttm_tt_create’:
>  drivers/gpu/drm/radeon/radeon_ttm.c:611:24: warning: variable ‘rdev’ set but 
> not used [-Wunused-but-set-variable]
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Jerome Glisse 
> 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_ttm.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c 
> b/drivers/gpu/drm/radeon/radeon_ttm.c
> index 95038ac3382e2..a8c915920070f 100644
> --- a/drivers/gpu/drm/radeon/radeon_ttm.c
> +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
> @@ -608,21 +608,21 @@ static void radeon_ttm_backend_destroy(struct 
> ttm_bo_device *bdev, struct ttm_tt
>  static struct ttm_tt *radeon_ttm_tt_create(struct ttm_buffer_object *bo,
>uint32_t page_flags)
>  {
> -   struct radeon_device *rdev;
> struct radeon_ttm_tt *gtt;
> enum ttm_caching caching;
> struct radeon_bo *rbo;
> -
> -   rbo = container_of(bo, struct radeon_bo, tbo);
> +#if IS_ENABLED(CONFIG_AGP)
> +   struct radeon_device *rdev;
>
> rdev = radeon_get_rdev(bo->bdev);
> -#if IS_ENABLED(CONFIG_AGP)
> if (rdev->flags & RADEON_IS_AGP) {
> return ttm_agp_tt_create(bo, rdev->ddev->agp->bridge,
>  page_flags);
> }
>  #endif
>
> +   rbo = container_of(bo, struct radeon_bo, tbo);
> +
> gtt = kzalloc(sizeof(struct radeon_ttm_tt), GFP_KERNEL);
> if (gtt == NULL) {
> return NULL;
> --
> 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 18/19] drm/radeon/atombios_crtc: Remove description of non-existent function param 'encoder'

2020-11-10 Thread Alex Deucher
On Fri, Nov 6, 2020 at 4:50 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/atombios_crtc.c:1796: warning: Excess function 
> parameter 'encoder' description in 'radeon_get_shared_nondp_ppll'
>
> 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_crtc.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c 
> b/drivers/gpu/drm/radeon/atombios_crtc.c
> index 91811757104c0..1979ed3d65472 100644
> --- a/drivers/gpu/drm/radeon/atombios_crtc.c
> +++ b/drivers/gpu/drm/radeon/atombios_crtc.c
> @@ -1787,7 +1787,6 @@ static int radeon_get_shared_dp_ppll(struct drm_crtc 
> *crtc)
>   * radeon_get_shared_nondp_ppll - return the PPLL used by another non-DP crtc
>   *
>   * @crtc: drm crtc
> - * @encoder: drm encoder
>   *
>   * Returns the PPLL (Pixel PLL) used by another non-DP crtc/encoder which can
>   * be shared (i.e., same clock).
> --
> 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 15/19] drm/radeon: Move prototypes to shared header

2020-11-10 Thread Alex Deucher
On Fri, Nov 6, 2020 at 4:50 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.h | 6 ++
>  drivers/gpu/drm/radeon/radeon_display.c | 4 
>  2 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
> index e1132d86d2507..961a31b8805c2 100644
> --- a/drivers/gpu/drm/radeon/radeon.h
> +++ b/drivers/gpu/drm/radeon/radeon.h
> @@ -2832,6 +2832,12 @@ extern void radeon_program_register_sequence(struct 
> radeon_device *rdev,
>  const u32 array_size);
>  struct radeon_device *radeon_get_rdev(struct ttm_bo_device *bdev);
>
> +/* KMS */
> +
> +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);
> +
>  /*
>   * vm
>   */
> diff --git a/drivers/gpu/drm/radeon/radeon_display.c 
> b/drivers/gpu/drm/radeon/radeon_display.c
> index b79686cf8bdbd..bd60f16fd0d78 100644
> --- a/drivers/gpu/drm/radeon/radeon_display.c
> +++ b/drivers/gpu/drm/radeon/radeon_display.c
> @@ -45,10 +45,6 @@
>  #include "atom.h"
>  #include "radeon.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);
> -
>  static void avivo_crtc_load_lut(struct drm_crtc *crtc)
>  {
> struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
> --
> 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/19] drm/radeon/radeon_drv: Move prototypes to a shared headerfile

2020-11-10 Thread Alex Deucher
On Fri, Nov 6, 2020 at 4:50 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  62 | void radeon_driver_unload_kms(struct drm_device *dev)
>  | ^~~~
>  drivers/gpu/drm/radeon/radeon_kms.c:105:5: warning: no previous prototype 
> for ‘radeon_driver_load_kms’ [-Wmissing-prototypes]
>  105 | int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
>  | ^~
>  drivers/gpu/drm/radeon/radeon_kms.c:619:6: warning: no previous prototype 
> for ‘radeon_driver_lastclose_kms’ [-Wmissing-prototypes]
>  619 | void radeon_driver_lastclose_kms(struct drm_device *dev)
>  | ^~~
>  drivers/gpu/drm/radeon/radeon_kms.c:634:5: warning: no previous prototype 
> for ‘radeon_driver_open_kms’ [-Wmissing-prototypes]
>  634 | int radeon_driver_open_kms(struct drm_device *dev, struct drm_file 
> *file_priv)
>  | ^~
>  drivers/gpu/drm/radeon/radeon_kms.c:705:6: warning: no previous prototype 
> for ‘radeon_driver_postclose_kms’ [-Wmissing-prototypes]
>  705 | void radeon_driver_postclose_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 | 6 --
>  drivers/gpu/drm/radeon/radeon_drv.h | 7 +++
>  2 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c 
> b/drivers/gpu/drm/radeon/radeon_drv.c
> index bb7b33e535f81..e0d664e9e2feb 100644
> --- a/drivers/gpu/drm/radeon/radeon_drv.c
> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
> @@ -112,12 +112,6 @@
>  #define KMS_DRIVER_MAJOR   2
>  #define KMS_DRIVER_MINOR   50
>  #define KMS_DRIVER_PATCHLEVEL  0
> -int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags);
> -void radeon_driver_unload_kms(struct drm_device *dev);
> -void radeon_driver_lastclose_kms(struct drm_device *dev);
> -int radeon_driver_open_kms(struct drm_device *dev, struct drm_file 
> *file_priv);
> -void radeon_driver_postclose_kms(struct drm_device *dev,
> -struct drm_file *file_priv);
>  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);
> diff --git a/drivers/gpu/drm/radeon/radeon_drv.h 
> b/drivers/gpu/drm/radeon/radeon_drv.h
> index 173deb4634146..ac7970919c4d3 100644
> --- a/drivers/gpu/drm/radeon/radeon_drv.h
> +++ b/drivers/gpu/drm/radeon/radeon_drv.h
> @@ -118,4 +118,11 @@
>  long radeon_drm_ioctl(struct file *filp,
>   unsigned int cmd, unsigned long arg);
>
> +int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags);
> +void radeon_driver_unload_kms(struct drm_device *dev);
> +void radeon_driver_lastclose_kms(struct drm_device *dev);
> +int radeon_driver_open_kms(struct drm_device *dev, struct drm_file 
> *file_priv);
> +void radeon_driver_postclose_kms(struct drm_device *dev,
> +struct drm_file *file_priv);
> +
>  #endif /* __RADEON_DRV_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 11/19] drm/radeon/radeon_drv: Source file headers are not good candidates for kernel-doc

2020-11-10 Thread Alex Deucher
On Fri, Nov 6, 2020 at 4:50 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_drv.c:2: warning: Cannot understand  * file 
> radeon_drv.c
>
> 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 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c 
> b/drivers/gpu/drm/radeon/radeon_drv.c
> index 560267cc25892..bb7b33e535f81 100644
> --- a/drivers/gpu/drm/radeon/radeon_drv.c
> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
> @@ -1,4 +1,4 @@
> -/**
> +/*
>   * \file radeon_drv.c
>   * ATI Radeon driver
>   *
> --
> 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/19] drm/radeon/radeon_kms: Include header containing our own prototypes

2020-11-10 Thread Alex Deucher
On Fri, Nov 6, 2020 at 4:50 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_kms.c:61:6: warning: no previous prototype for 
> ‘radeon_driver_unload_kms’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/radeon_kms.c:104:5: warning: no previous prototype 
> for ‘radeon_driver_load_kms’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/radeon_kms.c:618:6: warning: no previous prototype 
> for ‘radeon_driver_lastclose_kms’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/radeon_kms.c:633:5: warning: no previous prototype 
> for ‘radeon_driver_open_kms’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/radeon_kms.c:704:6: warning: no previous prototype 
> for ‘radeon_driver_postclose_kms’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/radeon_kms.c:755:5: warning: no previous prototype 
> for ‘radeon_get_vblank_counter_kms’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/radeon_kms.c:825:5: warning: no previous prototype 
> for ‘radeon_enable_vblank_kms’ [-Wmissing-prototypes]
>  drivers/gpu/drm/radeon/radeon_kms.c:852:6: warning: no previous prototype 
> for ‘radeon_disable_vblank_kms’ [-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/radeon_kms.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_kms.c 
> b/drivers/gpu/drm/radeon/radeon_kms.c
> index 99ee60f8b604d..0d8fbabffcead 100644
> --- a/drivers/gpu/drm/radeon/radeon_kms.c
> +++ b/drivers/gpu/drm/radeon/radeon_kms.c
> @@ -40,6 +40,7 @@
>
>  #include "radeon.h"
>  #include "radeon_asic.h"
> +#include "radeon_drv.h"
>
>  #if defined(CONFIG_VGA_SWITCHEROO)
>  bool radeon_has_atpx(void);
> --
> 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/19] drm/radeon/atom: Move prototype into shared location

2020-11-10 Thread Alex Deucher
On Fri, Nov 6, 2020 at 4:50 PM Lee Jones  wrote:
>
> Both source files include atom.h, which seems like a reasonable
> location to place an atom based function into.
>
> 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/atom.h  | 6 ++
>  drivers/gpu/drm/radeon/atombios_encoders.c | 4 
>  2 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/atom.h b/drivers/gpu/drm/radeon/atom.h
> index 1bf06c91cd959..cb93b83114dbe 100644
> --- a/drivers/gpu/drm/radeon/atom.h
> +++ b/drivers/gpu/drm/radeon/atom.h
> @@ -154,6 +154,12 @@ 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 drm_display_mode;
> +struct radeon_device;
> +bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index,
> +   struct drm_display_mode *mode);
> +

I'd prefer to add radeon_atombios.h for all of the stuff exported from
radeon_atombios.c.  When you add the .h file, please take the
copyright license from the .c file which implements the functions.

Thanks,

Alex

>  #include "atom-types.h"
>  #include "atombios.h"
>  #include "ObjectID.h"
> diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c 
> b/drivers/gpu/drm/radeon/atombios_encoders.c
> index cc5ee1b3af84f..85f903caf12e1 100644
> --- a/drivers/gpu/drm/radeon/atombios_encoders.c
> +++ b/drivers/gpu/drm/radeon/atombios_encoders.c
> @@ -296,10 +296,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)
> --
> 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 17/19] gpu: drm: radeon: radeon_device: Fix a bunch of kernel-doc misdemeanours

2020-11-10 Thread Alex Deucher
On Thu, Nov 5, 2020 at 9:52 AM Lee Jones  wrote:
>
>  - Demote non-conformant headers
>  - Fix misnaming issues
>  - Rename labels with identical names
>  - Remove incorrect descriptions
>
> 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]
>  drivers/gpu/drm/radeon/radeon_device.c:552: warning: duplicate section name 
> 'Note'
>  drivers/gpu/drm/radeon/radeon_device.c:556: warning: duplicate section name 
> 'Note'
>  drivers/gpu/drm/radeon/radeon_device.c:561: warning: duplicate section name 
> 'Note'
>  drivers/gpu/drm/radeon/radeon_device.c:564: warning: duplicate section name 
> 'Note'
>  drivers/gpu/drm/radeon/radeon_device.c:1106: warning: Function parameter or 
> member 'family' not described in 'radeon_gart_size_auto'
>  drivers/gpu/drm/radeon/radeon_device.c:1291: warning: Function parameter or 
> member 'ddev' not described in 'radeon_device_init'
>  drivers/gpu/drm/radeon/radeon_device.c:1565: warning: Function parameter or 
> member 'dev' not described in 'radeon_suspend_kms'
>  drivers/gpu/drm/radeon/radeon_device.c:1565: warning: Function parameter or 
> member 'suspend' not described in 'radeon_suspend_kms'
>  drivers/gpu/drm/radeon/radeon_device.c:1565: warning: Function parameter or 
> member 'fbcon' not described in 'radeon_suspend_kms'
>  drivers/gpu/drm/radeon/radeon_device.c:1565: warning: Function parameter or 
> member 'freeze' not described in 'radeon_suspend_kms'
>  drivers/gpu/drm/radeon/radeon_device.c:1565: warning: Excess function 
> parameter 'pdev' description in 'radeon_suspend_kms'
>  drivers/gpu/drm/radeon/radeon_device.c:1565: warning: Excess function 
> parameter 'state' description in 'radeon_suspend_kms'
>  drivers/gpu/drm/radeon/radeon_device.c:1669: warning: Function parameter or 
> member 'dev' not described in 'radeon_resume_kms'
>  drivers/gpu/drm/radeon/radeon_device.c:1669: warning: Function parameter or 
> member 'resume' not described in 'radeon_resume_kms'
>  drivers/gpu/drm/radeon/radeon_device.c:1669: warning: Function parameter or 
> member 'fbcon' not described in 'radeon_resume_kms'
>  drivers/gpu/drm/radeon/radeon_device.c:1669: warning: Excess function 
> parameter 'pdev' description in 'radeon_resume_kms'
>
> 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_device.c | 23 +--
>  1 file changed, 9 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_device.c 
> b/drivers/gpu/drm/radeon/radeon_device.c
> index 266e3cbbd09bd..7f384ffe848a7 100644
> --- a/drivers/gpu/drm/radeon/radeon_device.c
> +++ b/drivers/gpu/drm/radeon/radeon_device.c
> @@ -544,21 +544,21 @@ int radeon_wb_init(struct radeon_device *rdev)
>   * Note: GTT start, end, size should be initialized before calling this
>   * function on AGP platform.
>   *
> - * Note: We don't explicitly enforce VRAM start to be aligned on VRAM size,
> + * Note 1: We don't explicitly enforce VRAM start to be aligned on VRAM size,
>   * this shouldn't be a problem as we are using the PCI aperture as a 
> reference.
>   * Otherwise this would be needed for rv280, all r3xx, and all r4xx, but
>   * not IGP.
>   *
> - * Note: we use mc_vram_size as on some board we need to program the mc to
> + * Note 2: we use mc_vram_size as on some board we need to program the mc to
>   * cover the whole aperture even if VRAM size is inferior to aperture size
>   * Novell bug 204882 + along with lots of ubuntu ones
>   *
> - * Note: when limiting vram it's safe to overwritte real_vram_size because
> + * Note 3: when limiting vram it's safe to overwritte real_vram_size because
>   * we are not in case where real_vram_size is inferior to mc_vram_size (ie
>   * note afected by bogus hw of Novell bug 204882 + along with lots of ubuntu
>   * ones)
>   *
> - * Note: IGP TOM addr should be the same as the aperture addr, we don't
> + * Note 4: IGP TOM addr should be the same as the aperture addr, we don't
>   * explicitly check for that thought.
>   *
>   * FIXME: when reducing VRAM size align new size on power of 2.
> @@ -627,7 +627,7 @@ void radeon_gtt_location(struct radeon_device *rdev, 
> struct radeon_mc *mc)
>   * GPU helpers function.
>   */
>
> -/**
> +/*
>   * radeon_device_is_virtual - check if we are running is a virtual 
> environment
>   *
>   * Check if the asic has been passed through to a VM (all asics).
> @@ -1100,7 +1100,7 @@ static bool radeon_check_pot_argument(int arg)
>  /**
>   * Determine a sensible default GART size according to ASIC family.
>   *
> - * @family ASIC family name
> + * @family: ASIC family name
>   */
>  static int radeon_gart_size_auto(enum radeon_family family)
>  {
> @@ -1276,7 +1276,7 @@ static const struct 

Re: [PATCH 18/19] gpu: drm: amd: amdgpu: amdgpu: Mark global variables as __maybe_unused

2020-11-10 Thread Alex Deucher
On Thu, Nov 5, 2020 at 9:52 AM Lee Jones  wrote:
>
> These 3 variables are used in *some* sourcefiles which include
> amdgpu.h, but not *all*.  This leads to a flurry of build warnings.
>
> Fixes the following W=1 kernel build warning(s):
>
>  from drivers/gpu/drm/amd/amdgpu/amdgpu.h:67,
>  drivers/gpu/drm/amd/amdgpu/amdgpu.h:198:19: warning: ‘no_system_mem_limit’ 
> defined but not used [-Wunused-const-variable=]
>  drivers/gpu/drm/amd/amdgpu/amdgpu.h:197:19: warning: ‘debug_evictions’ 
> defined but not used [-Wunused-const-variable=]
>  drivers/gpu/drm/amd/amdgpu/amdgpu.h:196:18: warning: ‘sched_policy’ defined 
> but not used [-Wunused-const-variable=]
>
>  NB: Repeats ~650 times - snipped for brevity.
>
> 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/amd/amdgpu/amdgpu.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index 183b09d71b64a..5939753080056 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -193,9 +193,9 @@ extern int sched_policy;
>  extern bool debug_evictions;
>  extern bool no_system_mem_limit;
>  #else
> -static const int sched_policy = KFD_SCHED_POLICY_HWS;
> -static const bool debug_evictions; /* = false */
> -static const bool no_system_mem_limit;
> +static const int __maybe_unused sched_policy = KFD_SCHED_POLICY_HWS;
> +static const bool __maybe_unused debug_evictions; /* = false */
> +static const bool __maybe_unused no_system_mem_limit;
>  #endif
>
>  extern int amdgpu_tmz;
> --
> 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 15/19] gpu: drm: radeon: radeon_drv: Remove unused variable 'ret'

2020-11-10 Thread Alex Deucher
On Thu, Nov 5, 2020 at 9:52 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_drv.c: In function 
> ‘radeon_pmops_runtime_suspend’:
>  drivers/gpu/drm/radeon/radeon_drv.c:455:6: warning: variable ‘ret’ set but 
> not used [-Wunused-but-set-variable]
>
> 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 | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c 
> b/drivers/gpu/drm/radeon/radeon_drv.c
> index 65061c949aeea..f5f1cb700d873 100644
> --- a/drivers/gpu/drm/radeon/radeon_drv.c
> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
> @@ -452,7 +452,6 @@ static int radeon_pmops_runtime_suspend(struct device 
> *dev)
>  {
> struct pci_dev *pdev = to_pci_dev(dev);
> struct drm_device *drm_dev = pci_get_drvdata(pdev);
> -   int ret;
>
> if (!radeon_is_px(drm_dev)) {
> pm_runtime_forbid(dev);
> @@ -462,7 +461,7 @@ static int radeon_pmops_runtime_suspend(struct device 
> *dev)
> drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
> drm_kms_helper_poll_disable(drm_dev);
>
> -   ret = radeon_suspend_kms(drm_dev, false, false, false);
> +   radeon_suspend_kms(drm_dev, false, false, false);
> pci_save_state(pdev);
> pci_disable_device(pdev);
> pci_ignore_hotplug(pdev);
> --
> 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 15/20] drm/radeon/r600d: Move 'rc600_*' prototypes into shared header

2020-11-10 Thread Lee Jones
On Tue, 10 Nov 2020, Alex Deucher wrote:

> On Tue, Nov 10, 2020 at 4:41 AM Lee Jones  wrote:
> >
> > On Tue, 10 Nov 2020, Sam Ravnborg wrote:
> >
> > > Hi Lee,
> > >
> > > > > the *d.h headers are supposed to just be hardware definitions.  I'd
> > > > > prefer to keep driver stuff out of them.
> > > >
> > > > That's fine (I did wonder if that were the case).
> > > >
> > > > I need an answer from you and Sam whether I can create new headers.
> > > >
> > > > For me, it is the right thing to do.
> > >
> > > Please follow the advice of Alex for the radeon driver.
> >
> > Great.  Thanks for resolving this Sam.
> >
> > Will fix all occurrences.
> 
> I'm not really following these patch sets you are sending out.  They
> all seem completely independent.  I was expecting updated versions
> with feedback integrated, but they seem to be just different fixes.
> Are you planning to send out updated versions based on feedback from
> these series?  Also, some of the patches have subtle errors in them
> (e.g., wrong descriptions of variables, wrong copyright headers on new
> files, etc.), do you mind if I fix them up locally when applying or
> would you rather I point out the changes and you can integrate them
> and resend?

Apologies for any confusion.  Let me try to shed some light.

All 4 sets sent thus far have been independent.  There are 5000 issues
to solve in drivers/gpu - I'm trying my best to whittle them down.
We're down to 2200 right now, so it seems to be going well.

I'm aware that some of the patches have been accepted already, so the
plan is to wait a few days, let them settle into -next, then start;
rebasing sets, applying fix-ups and sending out v2s.

FYI: There are also outstanding rebases due for; wireless, net, input
and SCSI, as well as the 4 DRM sets.  I'm getting to all of them.

With regards to how you deal with incorrectness, that's entirely up to
you.  Feel free to either fix-up any issues you see or to provide
review comments and let me deal with it.  Whatever works for you.

A note on copyrights on new files; the new files are copied directly
from old, previously accepted/currently residing ones in order to keep
in-line with what's expected of the subsystem.  If the format has been
updated and/or you would like them modernised, please either fix them
up at your leisure or let me know what's required and I'll rework and
resubmit them.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH] drm/amd/amdgpu: Update VCN initizalization behvaior

2020-11-10 Thread Bokun Zhang
- Issue:
  In the original vcn3.0 code, it assumes that the VCN's
  init_status is always 1, even after the MMSCH
  updates the header.

  This is incorrect since by default, it should be set to 0,
  and MMSCH will update it to 1 if VCN is ready.

- Fix:
  We need to read back the table header after send it to MMSCH.
  After that, if a VCN instance is not ready (host disabled it),
  we needs to disable the ring buffer as well.

Change-Id: I2c5dc4344c5919044370dfe606bf5980a202c662

Signed-off-by: Bokun Zhang 
---
 drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 46 +--
 1 file changed, 37 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c 
b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
index 3970a0ccb6a5..c5e0a531caba 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
@@ -294,17 +294,19 @@ static int vcn_v3_0_hw_init(void *handle)
continue;
 
ring = >vcn.inst[i].ring_dec;
-   ring->wptr = 0;
-   ring->wptr_old = 0;
-   vcn_v3_0_dec_ring_set_wptr(ring);
-   ring->sched.ready = true;
+   if (ring->sched.ready) {
+   ring->wptr = 0;
+   ring->wptr_old = 0;
+   vcn_v3_0_dec_ring_set_wptr(ring);
+   }
 
for (j = 0; j < adev->vcn.num_enc_rings; ++j) {
ring = >vcn.inst[i].ring_enc[j];
-   ring->wptr = 0;
-   ring->wptr_old = 0;
-   vcn_v3_0_enc_ring_set_wptr(ring);
-   ring->sched.ready = true;
+   if (ring->sched.ready) {
+   ring->wptr = 0;
+   ring->wptr_old = 0;
+   vcn_v3_0_enc_ring_set_wptr(ring);
+   }
}
}
} else {
@@ -1230,6 +1232,8 @@ static int vcn_v3_0_start_sriov(struct amdgpu_device 
*adev)
uint32_t table_size;
uint32_t size, size_dw;
 
+   bool is_vcn_ready;
+
struct mmsch_v3_0_cmd_direct_write
direct_wt = { {0} };
struct mmsch_v3_0_cmd_direct_read_modify_write
@@ -1367,7 +1371,7 @@ static int vcn_v3_0_start_sriov(struct amdgpu_device 
*adev)
MMSCH_V3_0_INSERT_END();
 
/* refine header */
-   header.inst[i].init_status = 1;
+   header.inst[i].init_status = 0;
header.inst[i].table_offset = header.total_size;
header.inst[i].table_size = table_size;
header.total_size += table_size;
@@ -1425,6 +1429,30 @@ static int vcn_v3_0_start_sriov(struct amdgpu_device 
*adev)
}
}
 
+   /* 6, check each VCN's init_status
+* if it remains as 0, then this VCN is not assigned to current VF
+* do not start ring for this VCN
+*/
+   size = sizeof(struct mmsch_v3_0_init_header);
+   table_loc = (uint32_t *)table->cpu_addr;
+   memcpy(, (void *)table_loc, size);
+
+   for (i = 0; i < adev->vcn.num_vcn_inst; i++) {
+   if (adev->vcn.harvest_config & (1 << i))
+   continue;
+
+   is_vcn_ready = (header.inst[i].init_status == 1);
+   if (!is_vcn_ready)
+   DRM_INFO("VCN(%d) engine is disabled by hypervisor\n", 
i);
+
+   ring = >vcn.inst[i].ring_dec;
+   ring->sched.ready = is_vcn_ready;
+   for (j = 0; j < adev->vcn.num_enc_rings; ++j) {
+   ring = >vcn.inst[i].ring_enc[j];
+   ring->sched.ready = is_vcn_ready;
+   }
+   }
+
return 0;
 }
 
-- 
2.20.1

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


Re: [PATCH 15/20] drm/radeon/r600d: Move 'rc600_*' prototypes into shared header

2020-11-10 Thread Alex Deucher
On Tue, Nov 10, 2020 at 4:41 AM Lee Jones  wrote:
>
> On Tue, 10 Nov 2020, Sam Ravnborg wrote:
>
> > Hi Lee,
> >
> > > > the *d.h headers are supposed to just be hardware definitions.  I'd
> > > > prefer to keep driver stuff out of them.
> > >
> > > That's fine (I did wonder if that were the case).
> > >
> > > I need an answer from you and Sam whether I can create new headers.
> > >
> > > For me, it is the right thing to do.
> >
> > Please follow the advice of Alex for the radeon driver.
>
> Great.  Thanks for resolving this Sam.
>
> Will fix all occurrences.

I'm not really following these patch sets you are sending out.  They
all seem completely independent.  I was expecting updated versions
with feedback integrated, but they seem to be just different fixes.
Are you planning to send out updated versions based on feedback from
these series?  Also, some of the patches have subtle errors in them
(e.g., wrong descriptions of variables, wrong copyright headers on new
files, etc.), do you mind if I fix them up locally when applying or
would you rather I point out the changes and you can integrate them
and resend?

Thanks,

Alex

>
> --
> Lee Jones [李琼斯]
> Senior Technical Lead - Developer Services
> Linaro.org │ Open source software for Arm SoCs
> Follow Linaro: Facebook | Twitter | Blog
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH 15/30] drm/radeon/cik_sdma: Demote vague attempt at kernel-doc

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

 drivers/gpu/drm/radeon/cik_sdma.c:949: warning: Function parameter or member 
'ring' not described in 'cik_dma_vm_flush'
 drivers/gpu/drm/radeon/cik_sdma.c:949: warning: Function parameter or member 
'vm_id' not described in 'cik_dma_vm_flush'
 drivers/gpu/drm/radeon/cik_sdma.c:949: warning: Function parameter or member 
'pd_addr' not described in 'cik_dma_vm_flush'

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_sdma.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/cik_sdma.c 
b/drivers/gpu/drm/radeon/cik_sdma.c
index 68403e77756d3..3c709ebe8d1ab 100644
--- a/drivers/gpu/drm/radeon/cik_sdma.c
+++ b/drivers/gpu/drm/radeon/cik_sdma.c
@@ -936,11 +936,9 @@ void cik_sdma_vm_pad_ib(struct radeon_ib *ib)
ib->ptr[ib->length_dw++] = SDMA_PACKET(SDMA_OPCODE_NOP, 0, 0);
 }
 
-/**
+/*
  * cik_dma_vm_flush - cik vm flush using sDMA
  *
- * @rdev: radeon_device pointer
- *
  * Update the page table base and flush the VM TLB
  * using sDMA (CIK).
  */
-- 
2.25.1

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


[PATCH 00/30] [Set 4] Rid W=1 warnings from GPU

2020-11-10 Thread Lee Jones
This set is part of a larger effort attempting to clean-up W=1
kernel builds, which are currently overwhelmingly riddled with
niggly little warnings.

Exciting times (using Arm as the benchmark):

 Before these sets:
  5031 drivers/gpu/
   3923 drivers/gpu/drm/amd/
258 drivers/gpu/drm/radeon/
 95 drivers/gpu/drm/nouveau/
 77 drivers/gpu/drm/msm/

 After these sets:
  2236 drivers/gpu/
1949 drivers/gpu/drm/amd/
  97 drivers/gpu/drm/nouveau/
  83 drivers/gpu/drm/msm/
  40 drivers/gpu/drm/radeon

Couple more to go.

Plan is to finsish off Radeon, then start targeting AMD tomorrow.

Lee Jones (30):
  drm/radeon/evergreen: Add comment for 'evergreen_page_flip()'s 'async'
param
  drm/radeon/evergreen: Remove set but unused variable 'mc_shared_chmap'
  drm/radeon/ni: Demote vague attempt at function header doc
  drm/radeon/si: Remove set but unused variable 'mc_shared_chmap'
  drm/radeon/cik: Remove set but unused variable 'mc_shared_chmap'
  drm/radeon/trinity_dpm: Remove some defined but never used arrays
  drm/radeon/kv_dpm: Strip out unused functions and their tables
  drm/radeon/ci_dpm: Remove set but unused variable 'dpm_event_src'
  drm/radeon/radeon_vm: Fix some function parameter documentation
  drm/radeon/radeon_sync: Add description for function param 'rdev'
  drm/radeon/radeon_ib: Supply description for 'radeon_ib_get's get
param
  drm/radeon/radeon_dp_mst: Remove unused variable 'ret' from
radeon_mst_encoder_dpms()
  drm/radeon/radeon_mn: Supply description for 'cur_seq' even if it is
unused
  drm/radeon/evergreen_dma: Fix doc-rot of function parameter 'resv'
  drm/radeon/cik_sdma: Demote vague attempt at kernel-doc
  drm/radeon/r100: Fix some kernel-doc formatting, misnaming and missing
issues
  drm/radeon/r600_cs: Fix some doc-rot and supply missing function param
docs
  drm/radeon/evergreen_cs: Fix misnaming issues surrounding 'p' param
  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/sumo_dpm: Move 'sumo_get_pi()'s prototype into shared
header
  drm/radeon/ni_dpm: Move 'ni_get_{pi,ps}()'s into shared header
  drm/radeon/ni: Remove set but unused variable 'mc_shared_chmap'
  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

 drivers/gpu/drm/radeon/atom.h   |   6 +
 drivers/gpu/drm/radeon/btc_dpm.c|   3 +-
 drivers/gpu/drm/radeon/ci_dpm.c |  12 --
 drivers/gpu/drm/radeon/cik.c|   7 +-
 drivers/gpu/drm/radeon/cik_sdma.c   |   4 +-
 drivers/gpu/drm/radeon/cypress_dpm.c|   3 +-
 drivers/gpu/drm/radeon/evergreen.c  |  10 +-
 drivers/gpu/drm/radeon/evergreen_cs.c   |   6 +-
 drivers/gpu/drm/radeon/evergreen_dma.c  |   2 +-
 drivers/gpu/drm/radeon/evergreen_hdmi.c |   1 +
 drivers/gpu/drm/radeon/evergreen_hdmi.h |  69 
 drivers/gpu/drm/radeon/kv_dpm.c | 205 +---
 drivers/gpu/drm/radeon/ni.c |   9 +-
 drivers/gpu/drm/radeon/ni.h |  36 +
 drivers/gpu/drm/radeon/ni_dpm.c |   2 +-
 drivers/gpu/drm/radeon/ni_dpm.h |   3 +
 drivers/gpu/drm/radeon/r100.c   |   7 +-
 drivers/gpu/drm/radeon/r600.c   |   1 +
 drivers/gpu/drm/radeon/r600.h   |  35 
 drivers/gpu/drm/radeon/r600_cs.c|   9 +-
 drivers/gpu/drm/radeon/r600_dma.c   |   3 +-
 drivers/gpu/drm/radeon/radeon_audio.c   |  26 +--
 drivers/gpu/drm/radeon/radeon_dp_mst.c  |  16 +-
 drivers/gpu/drm/radeon/radeon_drv.c |   7 +-
 drivers/gpu/drm/radeon/radeon_gem.c |   9 +-
 drivers/gpu/drm/radeon/radeon_i2c.c |   4 -
 drivers/gpu/drm/radeon/radeon_ib.c  |   1 +
 drivers/gpu/drm/radeon/radeon_irq_kms.c |   1 +
 drivers/gpu/drm/radeon/radeon_kms.h |   5 +
 drivers/gpu/drm/radeon/radeon_mn.c  |   1 +
 drivers/gpu/drm/radeon/radeon_prime.c   |   1 +
 drivers/gpu/drm/radeon/radeon_prime.h   |  39 +
 drivers/gpu/drm/radeon/radeon_sync.c|   1 +
 drivers/gpu/drm/radeon/radeon_ttm.h |   1 +
 drivers/gpu/drm/radeon/radeon_vm.c  |   8 +-
 drivers/gpu/drm/radeon/rv730_dpm.c  |   4 +-
 drivers/gpu/drm/radeon/rv740_dpm.c  |   3 +-
 drivers/gpu/drm/radeon/rv770.h  |   5 +
 drivers/gpu/drm/radeon/rv770_dpm.c  |   1 +
 drivers/gpu/drm/radeon/si.c |   7 +-
 drivers/gpu/drm/radeon/si_dpm.c |   5 +-
 

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

2020-11-10 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| 36 ++
 3 files changed, 38 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 efb19c445e48f..28830f4ef95e3 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..bb03ac702b1cc
--- /dev/null
+++ b/drivers/gpu/drm/radeon/ni.h
@@ -0,0 +1,36 @@
+/* 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__
+
+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 04/30] drm/radeon/si: Remove set but unused variable 'mc_shared_chmap'

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

 drivers/gpu/drm/radeon/si.c: In function ‘si_gpu_init’:
 drivers/gpu/drm/radeon/si.c:3090:6: warning: variable ‘mc_shared_chmap’ set 
but not used [-Wunused-but-set-variable]

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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index c27af89785f34..45076c27d7ded 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -3088,7 +3088,7 @@ static void si_setup_rb(struct radeon_device *rdev,
 static void si_gpu_init(struct radeon_device *rdev)
 {
u32 gb_addr_config = 0;
-   u32 mc_shared_chmap, mc_arb_ramcfg;
+   u32 mc_arb_ramcfg;
u32 sx_debug_1;
u32 hdp_host_path_cntl;
u32 tmp;
@@ -3200,7 +3200,7 @@ static void si_gpu_init(struct radeon_device *rdev)
 
WREG32(BIF_FB_EN, FB_READ_EN | FB_WRITE_EN);
 
-   mc_shared_chmap = RREG32(MC_SHARED_CHMAP);
+   RREG32(MC_SHARED_CHMAP);
mc_arb_ramcfg = RREG32(MC_ARB_RAMCFG);
 
rdev->config.si.num_tile_pipes = rdev->config.si.max_tile_pipes;
-- 
2.25.1

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


[PATCH 12/30] drm/radeon/radeon_dp_mst: Remove unused variable 'ret' from radeon_mst_encoder_dpms()

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

 drivers/gpu/drm/radeon/radeon_dp_mst.c: In function ‘radeon_mst_encoder_dpms’:
 drivers/gpu/drm/radeon/radeon_dp_mst.c:366:6: warning: variable ‘ret’ set but 
not used [-Wunused-but-set-variable]

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_dp_mst.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_dp_mst.c 
b/drivers/gpu/drm/radeon/radeon_dp_mst.c
index 008308780443c..2c32186c4acd9 100644
--- a/drivers/gpu/drm/radeon/radeon_dp_mst.c
+++ b/drivers/gpu/drm/radeon/radeon_dp_mst.c
@@ -363,7 +363,7 @@ radeon_mst_encoder_dpms(struct drm_encoder *encoder, int 
mode)
struct radeon_connector *radeon_connector;
struct drm_crtc *crtc;
struct radeon_crtc *radeon_crtc;
-   int ret, slots;
+   int slots;
s64 fixed_pbn, fixed_pbn_per_slot, avg_time_slots_per_mtp;
if (!ASIC_IS_DCE5(rdev)) {
DRM_ERROR("got mst dpms on non-DCE5\n");
@@ -418,10 +418,10 @@ radeon_mst_encoder_dpms(struct drm_encoder *encoder, int 
mode)
 
slots = 
drm_dp_find_vcpi_slots(_connector->mst_port->mst_mgr,
   mst_enc->pbn);
-   ret = 
drm_dp_mst_allocate_vcpi(_connector->mst_port->mst_mgr,
-  radeon_connector->port,
-  mst_enc->pbn, slots);
-   ret = 
drm_dp_update_payload_part1(_connector->mst_port->mst_mgr);
+   drm_dp_mst_allocate_vcpi(_connector->mst_port->mst_mgr,
+radeon_connector->port,
+mst_enc->pbn, slots);
+   
drm_dp_update_payload_part1(_connector->mst_port->mst_mgr);
 
radeon_dp_mst_set_be_cntl(primary, mst_enc,
  radeon_connector->mst_port->hpd.hpd, 
true);
@@ -436,9 +436,9 @@ radeon_mst_encoder_dpms(struct drm_encoder *encoder, int 
mode)
 
atombios_dig_encoder_setup2(>base, 
ATOM_ENCODER_CMD_DP_VIDEO_ON, 0,
mst_enc->fe);
-   ret = 
drm_dp_check_act_status(_connector->mst_port->mst_mgr);
+   drm_dp_check_act_status(_connector->mst_port->mst_mgr);
 
-   ret = 
drm_dp_update_payload_part2(_connector->mst_port->mst_mgr);
+   
drm_dp_update_payload_part2(_connector->mst_port->mst_mgr);
 
break;
case DRM_MODE_DPMS_STANDBY:
@@ -450,7 +450,7 @@ radeon_mst_encoder_dpms(struct drm_encoder *encoder, int 
mode)
return;
 

drm_dp_mst_reset_vcpi_slots(_connector->mst_port->mst_mgr, 
mst_enc->port);
-   ret = 
drm_dp_update_payload_part1(_connector->mst_port->mst_mgr);
+   
drm_dp_update_payload_part1(_connector->mst_port->mst_mgr);
 
drm_dp_check_act_status(_connector->mst_port->mst_mgr);
/* and this can also fail */
-- 
2.25.1

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


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

2020-11-10 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/30] drm/radeon/kv_dpm: Strip out unused functions and their tables

2020-11-10 Thread Lee Jones
These haven't been used since the driver was upstreamed in 2013.

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

 drivers/gpu/drm/radeon/kv_dpm.c:161:40: warning: ‘cpl_cac_config_reg’ defined 
but not used [-Wunused-const-variable=]
 drivers/gpu/drm/radeon/kv_dpm.c:156:40: warning: ‘mc3_cac_config_reg’ defined 
but not used [-Wunused-const-variable=]
 drivers/gpu/drm/radeon/kv_dpm.c:151:40: warning: ‘mc2_cac_config_reg’ defined 
but not used [-Wunused-const-variable=]
 drivers/gpu/drm/radeon/kv_dpm.c:146:40: warning: ‘mc1_cac_config_reg’ defined 
but not used [-Wunused-const-variable=]
 drivers/gpu/drm/radeon/kv_dpm.c:141:40: warning: ‘mc0_cac_config_reg’ defined 
but not used [-Wunused-const-variable=]
 drivers/gpu/drm/radeon/kv_dpm.c:136:40: warning: ‘sx0_cac_config_reg’ defined 
but not used [-Wunused-const-variable=]
 drivers/gpu/drm/radeon/kv_dpm.c:104:43: warning: ‘cpl_local_cac_cfg_kv’ 
defined but not used [-Wunused-const-variable=]
 drivers/gpu/drm/radeon/kv_dpm.c:98:43: warning: ‘mc3_local_cac_cfg_kv’ defined 
but not used [-Wunused-const-variable=]
 drivers/gpu/drm/radeon/kv_dpm.c:92:43: warning: ‘mc2_local_cac_cfg_kv’ defined 
but not used [-Wunused-const-variable=]
 drivers/gpu/drm/radeon/kv_dpm.c:86:43: warning: ‘mc1_local_cac_cfg_kv’ defined 
but not used [-Wunused-const-variable=]
 drivers/gpu/drm/radeon/kv_dpm.c:80:43: warning: ‘mc0_local_cac_cfg_kv’ defined 
but not used [-Wunused-const-variable=]
 drivers/gpu/drm/radeon/kv_dpm.c:67:43: warning: ‘sx_local_cac_cfg_kv’ defined 
but not used [-Wunused-const-variable=]

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/kv_dpm.c | 205 +---
 1 file changed, 1 insertion(+), 204 deletions(-)

diff --git a/drivers/gpu/drm/radeon/kv_dpm.c b/drivers/gpu/drm/radeon/kv_dpm.c
index 5e6086eb18073..f7735da07feb9 100644
--- a/drivers/gpu/drm/radeon/kv_dpm.c
+++ b/drivers/gpu/drm/radeon/kv_dpm.c
@@ -64,105 +64,6 @@ extern void cik_exit_rlc_safe_mode(struct radeon_device 
*rdev);
 extern void cik_update_cg(struct radeon_device *rdev,
  u32 block, bool enable);
 
-static const struct kv_lcac_config_values sx_local_cac_cfg_kv[] =
-{
-   {  0,   4,1},
-   {  1,   4,1},
-   {  2,   5,1},
-   {  3,   4,2},
-   {  4,   1,1},
-   {  5,   5,2},
-   {  6,   6,1},
-   {  7,   9,2},
-   { 0x }
-};
-
-static const struct kv_lcac_config_values mc0_local_cac_cfg_kv[] =
-{
-   {  0,   4,1},
-   { 0x }
-};
-
-static const struct kv_lcac_config_values mc1_local_cac_cfg_kv[] =
-{
-   {  0,   4,1},
-   { 0x }
-};
-
-static const struct kv_lcac_config_values mc2_local_cac_cfg_kv[] =
-{
-   {  0,   4,1},
-   { 0x }
-};
-
-static const struct kv_lcac_config_values mc3_local_cac_cfg_kv[] =
-{
-   {  0,   4,1},
-   { 0x }
-};
-
-static const struct kv_lcac_config_values cpl_local_cac_cfg_kv[] =
-{
-   {  0,   4,1},
-   {  1,   4,1},
-   {  2,   5,1},
-   {  3,   4,1},
-   {  4,   1,1},
-   {  5,   5,1},
-   {  6,   6,1},
-   {  7,   9,1},
-   {  8,   4,1},
-   {  9,   2,1},
-   {  10,  3,1},
-   {  11,  6,1},
-   {  12,  8,2},
-   {  13,  1,1},
-   {  14,  2,1},
-   {  15,  3,1},
-   {  16,  1,1},
-   {  17,  4,1},
-   {  18,  3,1},
-   {  19,  1,1},
-   {  20,  8,1},
-   {  21,  5,1},
-   {  22,  1,1},
-   {  23,  1,1},
-   {  24,  4,1},
-   {  27,  6,1},
-   {  28,  1,1},
-   { 0x }
-};
-
-static const struct kv_lcac_config_reg sx0_cac_config_reg[] =
-{
-   { 0xc0400d00, 0x003e, 17, 0x3fc0, 22, 0x0001fffe, 1, 
0x0001, 0 }
-};
-
-static const struct kv_lcac_config_reg mc0_cac_config_reg[] =
-{
-   { 0xc0400d30, 0x003e, 17, 0x3fc0, 22, 0x0001fffe, 1, 
0x0001, 0 }
-};
-
-static const struct kv_lcac_config_reg mc1_cac_config_reg[] =
-{
-   { 0xc0400d3c, 0x003e, 17, 0x3fc0, 22, 0x0001fffe, 1, 
0x0001, 0 }
-};
-
-static const struct kv_lcac_config_reg mc2_cac_config_reg[] =
-{
-   { 0xc0400d48, 0x003e, 17, 0x3fc0, 22, 0x0001fffe, 1, 
0x0001, 0 }
-};
-
-static const struct 

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

2020-11-10 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   | 6 ++
 drivers/gpu/drm/radeon/radeon_i2c.c | 4 
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atom.h b/drivers/gpu/drm/radeon/atom.h
index cb93b83114dbe..efc05e33b220c 100644
--- a/drivers/gpu/drm/radeon/atom.h
+++ b/drivers/gpu/drm/radeon/atom.h
@@ -160,6 +160,12 @@ struct radeon_device;
 bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index,
struct drm_display_mode *mode);
 
+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


[PATCH 17/30] drm/radeon/r600_cs: Fix some doc-rot and supply missing function param docs

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

 drivers/gpu/drm/radeon/r600_cs.c:793: warning: Function parameter or member 
'p' not described in 'r600_cs_packet_parse_vline'
 drivers/gpu/drm/radeon/r600_cs.c:793: warning: Excess function parameter 
'parser' description in 'r600_cs_packet_parse_vline'
 drivers/gpu/drm/radeon/r600_cs.c:826: warning: Function parameter or member 
'p' not described in 'r600_cs_common_vline_parse'
 drivers/gpu/drm/radeon/r600_cs.c:826: warning: Excess function parameter 
'parser' description in 'r600_cs_common_vline_parse'
 drivers/gpu/drm/radeon/r600_cs.c:968: warning: Function parameter or member 
'p' not described in 'r600_cs_check_reg'
 drivers/gpu/drm/radeon/r600_cs.c:968: warning: Excess function parameter 
'parser' description in 'r600_cs_check_reg'
 drivers/gpu/drm/radeon/r600_cs.c:1473: warning: Function parameter or member 
'base_offset' not described in 'r600_check_texture_resource'
 drivers/gpu/drm/radeon/r600_cs.c:1473: warning: Function parameter or member 
'mip_offset' not described in 'r600_check_texture_resource'
 drivers/gpu/drm/radeon/r600_cs.c:1473: warning: Function parameter or member 
'tiling_flags' not described in 'r600_check_texture_resource'

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_cs.c | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c
index 390a9621604ae..f20b619466816 100644
--- a/drivers/gpu/drm/radeon/r600_cs.c
+++ b/drivers/gpu/drm/radeon/r600_cs.c
@@ -782,7 +782,7 @@ static int r600_cs_track_check(struct radeon_cs_parser *p)
 
 /**
  * r600_cs_packet_parse_vline() - parse userspace VLINE packet
- * @parser:parser structure holding parsing context.
+ * @p: parser structure holding parsing context.
  *
  * This is an R600-specific function for parsing VLINE packets.
  * Real work is done by r600_cs_common_vline_parse function.
@@ -801,7 +801,7 @@ static int r600_cs_packet_parse_vline(struct 
radeon_cs_parser *p)
 
 /**
  * r600_cs_common_vline_parse() - common vline parser
- * @parser:parser structure holding parsing context.
+ * @p: parser structure holding parsing context.
  * @vline_start_end:table of vline_start_end registers
  * @vline_status:   table of vline_status registers
  *
@@ -956,7 +956,7 @@ static int r600_cs_parse_packet0(struct radeon_cs_parser *p,
 
 /**
  * r600_cs_check_reg() - check if register is authorized or not
- * @parser: parser structure holding parsing context
+ * @p: parser structure holding parsing context
  * @reg: register we are testing
  * @idx: index into the cs buffer
  *
@@ -1460,6 +1460,9 @@ static void r600_texture_size(unsigned nfaces, unsigned 
blevel, unsigned llevel,
  * @idx: index into the cs buffer
  * @texture: texture's bo structure
  * @mipmap: mipmap's bo structure
+ * @base_offset: base offset (used for error checking)
+ * @mip_offset: mip offset (used for error checking)
+ * @tiling_flags: tiling flags
  *
  * This function will check that the resource has valid field and that
  * the texture and mipmap bo object are big enough to cover this resource.
-- 
2.25.1

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


[PATCH 16/30] drm/radeon/r100: Fix some kernel-doc formatting, misnaming and missing issues

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

 drivers/gpu/drm/radeon/r100.c:163: warning: Function parameter or member 
'async' not described in 'r100_page_flip'
 drivers/gpu/drm/radeon/r100.c:848: warning: Function parameter or member 
'rdev' not described in 'r100_ring_hdp_flush'
 drivers/gpu/drm/radeon/r100.c:848: warning: Function parameter or member 
'ring' not described in 'r100_ring_hdp_flush'
 drivers/gpu/drm/radeon/r100.c:1425: warning: Function parameter or member 'p' 
not described in 'r100_cs_packet_parse_vline'
 drivers/gpu/drm/radeon/r100.c:1425: warning: Excess function parameter 
'parser' description in 'r100_cs_packet_parse_vline'

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/r100.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index 24c8db673931a..92075dedf2cb2 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -153,6 +153,7 @@ void r100_wait_for_vblank(struct radeon_device *rdev, int 
crtc)
  * @rdev: radeon_device pointer
  * @crtc_id: crtc to cleanup pageflip on
  * @crtc_base: new address of the crtc (GPU MC address)
+ * @async: unused
  *
  * Does the actual pageflip (r1xx-r4xx).
  * During vblank we take the crtc lock and wait for the update_pending
@@ -841,8 +842,8 @@ u32 r100_get_vblank_counter(struct radeon_device *rdev, int 
crtc)
 
 /**
  * r100_ring_hdp_flush - flush Host Data Path via the ring buffer
- * rdev: radeon device structure
- * ring: ring buffer struct for emitting packets
+ * @rdev: radeon device structure
+ * @ring: ring buffer struct for emitting packets
  */
 static void r100_ring_hdp_flush(struct radeon_device *rdev, struct radeon_ring 
*ring)
 {
@@ -1409,7 +1410,7 @@ int r100_cs_parse_packet0(struct radeon_cs_parser *p,
 
 /**
  * r100_cs_packet_next_vline() - parse userspace VLINE packet
- * @parser:parser structure holding parsing context.
+ * @p: parser structure holding parsing context.
  *
  * Userspace sends a special sequence for VLINE waits.
  * PACKET0 - VLINE_START_END + value
-- 
2.25.1

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


[PATCH 25/30] drm/radeon/sumo_dpm: Move 'sumo_get_pi()'s prototype into shared header

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

 drivers/gpu/drm/radeon/sumo_dpm.c:81:25: warning: no previous prototype for 
‘sumo_get_pi’ [-Wmissing-prototypes]
 81 | struct sumo_power_info *sumo_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/sumo_dpm.h | 1 +
 drivers/gpu/drm/radeon/sumo_smc.c | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/sumo_dpm.h 
b/drivers/gpu/drm/radeon/sumo_dpm.h
index f1651135a47ab..db29d37ae2703 100644
--- a/drivers/gpu/drm/radeon/sumo_dpm.h
+++ b/drivers/gpu/drm/radeon/sumo_dpm.h
@@ -207,6 +207,7 @@ u32 sumo_get_sleep_divider_from_id(u32 id);
 u32 sumo_get_sleep_divider_id_from_clock(struct radeon_device *rdev,
 u32 sclk,
 u32 min_sclk_in_sr);
+struct sumo_power_info *sumo_get_pi(struct radeon_device *rdev);
 
 /* sumo_smc.c */
 void sumo_initialize_m3_arb(struct radeon_device *rdev);
diff --git a/drivers/gpu/drm/radeon/sumo_smc.c 
b/drivers/gpu/drm/radeon/sumo_smc.c
index d781407057366..78d8716067318 100644
--- a/drivers/gpu/drm/radeon/sumo_smc.c
+++ b/drivers/gpu/drm/radeon/sumo_smc.c
@@ -30,8 +30,6 @@
 #define SUMO_SMU_SERVICE_ROUTINE_ALTVDDNB_NOTIFY  27
 #define SUMO_SMU_SERVICE_ROUTINE_GFX_SRV_ID_20  20
 
-struct sumo_power_info *sumo_get_pi(struct radeon_device *rdev);
-
 static void sumo_send_msg_to_smu(struct radeon_device *rdev, u32 id)
 {
u32 gfx_int_req;
-- 
2.25.1

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


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

2020-11-10 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 3521084030d24..7348ae52e2ef8 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 27/30] drm/radeon/ni: Remove set but unused variable 'mc_shared_chmap'

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

 drivers/gpu/drm/radeon/ni.c: In function ‘cayman_gpu_init’:
 drivers/gpu/drm/radeon/ni.c:880:6: warning: variable ‘mc_shared_chmap’ set but 
not used [-Wunused-but-set-variable]

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.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
index 12dd082069649..1c9030a4631b8 100644
--- a/drivers/gpu/drm/radeon/ni.c
+++ b/drivers/gpu/drm/radeon/ni.c
@@ -877,7 +877,7 @@ int tn_get_temp(struct radeon_device *rdev)
 static void cayman_gpu_init(struct radeon_device *rdev)
 {
u32 gb_addr_config = 0;
-   u32 mc_shared_chmap, mc_arb_ramcfg;
+   u32 mc_arb_ramcfg;
u32 cgts_tcc_disable;
u32 sx_debug_1;
u32 smx_dc_ctl0;
@@ -1002,7 +1002,7 @@ static void cayman_gpu_init(struct radeon_device *rdev)
 
evergreen_fix_pci_max_read_req_size(rdev);
 
-   mc_shared_chmap = RREG32(MC_SHARED_CHMAP);
+   RREG32(MC_SHARED_CHMAP);
mc_arb_ramcfg = RREG32(MC_ARB_RAMCFG);
 
tmp = (mc_arb_ramcfg & NOOFCOLS_MASK) >> NOOFCOLS_SHIFT;
-- 
2.25.1

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


[PATCH 18/30] drm/radeon/evergreen_cs: Fix misnaming issues surrounding 'p' param

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

 drivers/gpu/drm/radeon/evergreen_cs.c:1026: warning: Function parameter or 
member 'p' not described in 'evergreen_cs_packet_parse_vline'
 drivers/gpu/drm/radeon/evergreen_cs.c:1026: warning: Excess function parameter 
'parser' description in 'evergreen_cs_packet_parse_vline'
 drivers/gpu/drm/radeon/evergreen_cs.c:1095: warning: Function parameter or 
member 'p' not described in 'evergreen_cs_handle_reg'
 drivers/gpu/drm/radeon/evergreen_cs.c:1095: warning: Excess function parameter 
'parser' description in 'evergreen_cs_handle_reg'
 drivers/gpu/drm/radeon/evergreen_cs.c:1757: warning: Function parameter or 
member 'p' not described in 'evergreen_is_safe_reg'
 drivers/gpu/drm/radeon/evergreen_cs.c:1757: warning: Excess function parameter 
'parser' description in 'evergreen_is_safe_reg'

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 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c 
b/drivers/gpu/drm/radeon/evergreen_cs.c
index c410cad28f19f..53b75cf201958 100644
--- a/drivers/gpu/drm/radeon/evergreen_cs.c
+++ b/drivers/gpu/drm/radeon/evergreen_cs.c
@@ -1015,7 +1015,7 @@ static int evergreen_cs_track_check(struct 
radeon_cs_parser *p)
 
 /**
  * evergreen_cs_packet_parse_vline() - parse userspace VLINE packet
- * @parser:parser structure holding parsing context.
+ * @p: parser structure holding parsing context.
  *
  * This is an Evergreen(+)-specific function for parsing VLINE packets.
  * Real work is done by r600_cs_common_vline_parse function.
@@ -1087,7 +1087,7 @@ static int evergreen_cs_parse_packet0(struct 
radeon_cs_parser *p,
 
 /**
  * evergreen_cs_handle_reg() - process registers that need special handling.
- * @parser: parser structure holding parsing context
+ * @p: parser structure holding parsing context
  * @reg: register we are testing
  * @idx: index into the cs buffer
  */
@@ -1747,7 +1747,7 @@ static int evergreen_cs_handle_reg(struct 
radeon_cs_parser *p, u32 reg, u32 idx)
 
 /**
  * evergreen_is_safe_reg() - check if register is authorized or not
- * @parser: parser structure holding parsing context
+ * @p: parser structure holding parsing context
  * @reg: register we are testing
  *
  * This function will test against reg_safe_bm and return true
-- 
2.25.1

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


[PATCH 03/30] drm/radeon/ni: Demote vague attempt at function header doc

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

 drivers/gpu/drm/radeon/ni.c: In function ‘cayman_gpu_init’:
 drivers/gpu/drm/radeon/ni.c:2679: warning: Function parameter or member 'ring' 
not described in 'cayman_vm_flush'
 drivers/gpu/drm/radeon/ni.c:2679: warning: Function parameter or member 
'vm_id' not described in 'cayman_vm_flush'
 drivers/gpu/drm/radeon/ni.c:2679: warning: Function parameter or member 
'pd_addr' not described in 'cayman_vm_flush'

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.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
index 53a4d5c109794..12dd082069649 100644
--- a/drivers/gpu/drm/radeon/ni.c
+++ b/drivers/gpu/drm/radeon/ni.c
@@ -2668,11 +2668,9 @@ void cayman_vm_decode_fault(struct radeon_device *rdev,
   block, mc_id);
 }
 
-/**
+/*
  * cayman_vm_flush - vm flush using the CP
  *
- * @rdev: radeon_device pointer
- *
  * Update the page table base and flush the VM TLB
  * using the CP (cayman-si).
  */
-- 
2.25.1

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


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

2020-11-10 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   | 5 +
 drivers/gpu/drm/radeon/rv770_dpm.c   | 1 +
 drivers/gpu/drm/radeon/si_dpm.c  | 2 +-
 8 files changed, 12 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 de831684c9926..cf234d59f0475 100644
--- a/drivers/gpu/drm/radeon/rv770.h
+++ b/drivers/gpu/drm/radeon/rv770.h
@@ -28,6 +28,11 @@
 #ifndef __RADEON_RV770_H__
 #define __RADEON_RV770_H__
 
+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 11/30] drm/radeon/radeon_ib: Supply description for 'radeon_ib_get's get param

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

 drivers/gpu/drm/radeon/radeon_ib.c:61: warning: Function parameter or member 
'vm' not described in 'radeon_ib_get'

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_ib.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/radeon/radeon_ib.c 
b/drivers/gpu/drm/radeon/radeon_ib.c
index 9fd55e9c616b0..c1fca2ba443c9 100644
--- a/drivers/gpu/drm/radeon/radeon_ib.c
+++ b/drivers/gpu/drm/radeon/radeon_ib.c
@@ -48,6 +48,7 @@ static int radeon_debugfs_sa_init(struct radeon_device *rdev);
  *
  * @rdev: radeon_device pointer
  * @ring: ring index the IB is associated with
+ * @vm: requested vm
  * @ib: IB object returned
  * @size: requested IB size
  *
-- 
2.25.1

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


[PATCH 09/30] drm/radeon/radeon_vm: Fix some function parameter documentation

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

 drivers/gpu/drm/radeon/radeon_vm.c:131: warning: Function parameter or member 
'rdev' not described in 'radeon_vm_get_bos'
 drivers/gpu/drm/radeon/radeon_vm.c:643: warning: Excess function parameter 
'start' description in 'radeon_vm_update_page_directory'
 drivers/gpu/drm/radeon/radeon_vm.c:643: warning: Excess function parameter 
'end' description in 'radeon_vm_update_page_directory'
 drivers/gpu/drm/radeon/radeon_vm.c:819: warning: Function parameter or member 
'ib' not described in 'radeon_vm_update_ptes'
 drivers/gpu/drm/radeon/radeon_vm.c:915: warning: Function parameter or member 
'bo_va' not described in 'radeon_vm_bo_update'
 drivers/gpu/drm/radeon/radeon_vm.c:915: warning: Excess function parameter 
'vm' description in 'radeon_vm_bo_update'
 drivers/gpu/drm/radeon/radeon_vm.c:915: warning: Excess function parameter 
'bo' description in 'radeon_vm_bo_update'
 drivers/gpu/drm/radeon/radeon_vm.c:1155: warning: Excess function parameter 
'vm' description in 'radeon_vm_bo_invalidate'

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_vm.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_vm.c 
b/drivers/gpu/drm/radeon/radeon_vm.c
index 27b14eff532cb..71f2edcac6ea0 100644
--- a/drivers/gpu/drm/radeon/radeon_vm.c
+++ b/drivers/gpu/drm/radeon/radeon_vm.c
@@ -119,6 +119,7 @@ void radeon_vm_manager_fini(struct radeon_device *rdev)
 /**
  * radeon_vm_get_bos - add the vm BOs to a validation list
  *
+ * @rdev: radeon_device pointer
  * @vm: vm providing the BOs
  * @head: head of validation list
  *
@@ -629,8 +630,6 @@ static uint32_t radeon_vm_page_flags(uint32_t flags)
  *
  * @rdev: radeon_device pointer
  * @vm: requested vm
- * @start: start of GPU address range
- * @end: end of GPU address range
  *
  * Allocates new page tables if necessary
  * and updates the page directory (cayman+).
@@ -802,6 +801,7 @@ static void radeon_vm_frag_ptes(struct radeon_device *rdev,
  *
  * @rdev: radeon_device pointer
  * @vm: requested vm
+ * @ib: indirect buffer to use for the update
  * @start: start of GPU address range
  * @end: end of GPU address range
  * @dst: destination address to map to
@@ -900,8 +900,7 @@ static void radeon_vm_fence_pts(struct radeon_vm *vm,
  * radeon_vm_bo_update - map a bo into the vm page table
  *
  * @rdev: radeon_device pointer
- * @vm: requested vm
- * @bo: radeon buffer object
+ * @bo_va: radeon buffer object
  * @mem: ttm mem
  *
  * Fill in the page table entries for @bo (cayman+).
@@ -1145,7 +1144,6 @@ void radeon_vm_bo_rmv(struct radeon_device *rdev,
  * radeon_vm_bo_invalidate - mark the bo as invalid
  *
  * @rdev: radeon_device pointer
- * @vm: requested vm
  * @bo: radeon buffer object
  *
  * Mark @bo as invalid (cayman+).
-- 
2.25.1

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


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

2020-11-10 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   |  9 +--
 drivers/gpu/drm/radeon/radeon_prime.c |  1 +
 drivers/gpu/drm/radeon/radeon_prime.h | 39 +++
 3 files changed, 41 insertions(+), 8 deletions(-)
 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 0ccd7213e41ff..6db11e357565b 100644
--- a/drivers/gpu/drm/radeon/radeon_gem.c
+++ b/drivers/gpu/drm/radeon/radeon_gem.c
@@ -34,14 +34,7 @@
 #include 
 
 #include "radeon.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 *vaddr);
+#include "radeon_prime.h"
 
 static const struct drm_gem_object_funcs radeon_gem_object_funcs;
 
diff --git a/drivers/gpu/drm/radeon/radeon_prime.c 
b/drivers/gpu/drm/radeon/radeon_prime.c
index b9de0e51c0be9..789e076efbdc6 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 

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

2020-11-10 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 b94e2e678f255..a71645693cbdb 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -33,6 +33,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"
@@ -124,8 +125,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 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);
diff --git a/drivers/gpu/drm/radeon/r600.h b/drivers/gpu/drm/radeon/r600.h
index 1bf2d0572f047..73004ffb98124 100644
--- a/drivers/gpu/drm/radeon/r600.h
+++ b/drivers/gpu/drm/radeon/r600.h
@@ -29,5 +29,7 @@
 #define __R600_H__
 
 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 19/30] drm/radeon/radeon_drv: Move 'radeon_mmap()'s prototype to shared header

2020-11-10 Thread Lee Jones
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 
---
 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

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


[PATCH 05/30] drm/radeon/cik: Remove set but unused variable 'mc_shared_chmap'

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

 drivers/gpu/drm/radeon/cik.c: In function ‘cik_gpu_init’:
 drivers/gpu/drm/radeon/cik.c:3180:6: warning: variable ‘mc_shared_chmap’ set 
but not used [-Wunused-but-set-variable]

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 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index 4494f9122fd91..b94e2e678f255 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -3177,7 +3177,7 @@ static void cik_setup_rb(struct radeon_device *rdev,
 static void cik_gpu_init(struct radeon_device *rdev)
 {
u32 gb_addr_config = RREG32(GB_ADDR_CONFIG);
-   u32 mc_shared_chmap, mc_arb_ramcfg;
+   u32 mc_arb_ramcfg;
u32 hdp_host_path_cntl;
u32 tmp;
int i, j;
@@ -3270,7 +3270,7 @@ static void cik_gpu_init(struct radeon_device *rdev)
 
WREG32(BIF_FB_EN, FB_READ_EN | FB_WRITE_EN);
 
-   mc_shared_chmap = RREG32(MC_SHARED_CHMAP);
+   RREG32(MC_SHARED_CHMAP);
mc_arb_ramcfg = RREG32(MC_ARB_RAMCFG);
 
rdev->config.cik.num_tile_pipes = rdev->config.cik.max_tile_pipes;
-- 
2.25.1

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


[PATCH 01/30] drm/radeon/evergreen: Add comment for 'evergreen_page_flip()'s 'async' param

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

 drivers/gpu/drm/radeon/evergreen.c: In function ‘evergreen_gpu_init’:
 drivers/gpu/drm/radeon/evergreen.c:1419: warning: Function parameter or member 
'async' not described in 'evergreen_page_flip'

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 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/radeon/evergreen.c 
b/drivers/gpu/drm/radeon/evergreen.c
index 4eb3f9bc8fa8b..c9a9a87959f9e 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -1412,6 +1412,7 @@ void dce4_wait_for_vblank(struct radeon_device *rdev, int 
crtc)
  * @rdev: radeon_device pointer
  * @crtc_id: crtc to cleanup pageflip on
  * @crtc_base: new address of the crtc (GPU MC address)
+ * @async: Set retrace
  *
  * Triggers the actual pageflip by updating the primary
  * surface base address (evergreen+).
-- 
2.25.1

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


[PATCH 02/30] drm/radeon/evergreen: Remove set but unused variable 'mc_shared_chmap'

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

 drivers/gpu/drm/radeon/evergreen.c: In function ‘evergreen_gpu_init’:
 drivers/gpu/drm/radeon/evergreen.c:3135:6: warning: variable ‘mc_shared_chmap’ 
set but not used [-Wunused-but-set-variable]

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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/evergreen.c 
b/drivers/gpu/drm/radeon/evergreen.c
index c9a9a87959f9e..efb19c445e48f 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -3135,7 +3135,7 @@ static int evergreen_cp_resume(struct radeon_device *rdev)
 static void evergreen_gpu_init(struct radeon_device *rdev)
 {
u32 gb_addr_config;
-   u32 mc_shared_chmap, mc_arb_ramcfg;
+   u32 mc_arb_ramcfg;
u32 sx_debug_1;
u32 smx_dc_ctl0;
u32 sq_config;
@@ -3399,7 +3399,7 @@ static void evergreen_gpu_init(struct radeon_device *rdev)
 
evergreen_fix_pci_max_read_req_size(rdev);
 
-   mc_shared_chmap = RREG32(MC_SHARED_CHMAP);
+   RREG32(MC_SHARED_CHMAP);
if ((rdev->family == CHIP_PALM) ||
(rdev->family == CHIP_SUMO) ||
(rdev->family == CHIP_SUMO2))
-- 
2.25.1

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


[PATCH 13/30] drm/radeon/radeon_mn: Supply description for 'cur_seq' even if it is unused

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

 drivers/gpu/drm/radeon/radeon_mn.c:51: warning: Function parameter or member 
'cur_seq' not described in 'radeon_mn_invalidate'

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_mn.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/radeon/radeon_mn.c 
b/drivers/gpu/drm/radeon/radeon_mn.c
index 97b9b6dd6dd3b..3c4c4213a7b57 100644
--- a/drivers/gpu/drm/radeon/radeon_mn.c
+++ b/drivers/gpu/drm/radeon/radeon_mn.c
@@ -41,6 +41,7 @@
  *
  * @mn: our notifier
  * @range: the VMA under invalidation
+ * @cur_seq: unused
  *
  * We block for all BOs between start and end to be idle and
  * unmap them by move them into system domain again.
-- 
2.25.1

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


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

2020-11-10 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 | 33 +++
 drivers/gpu/drm/radeon/r600_dma.c |  3 +--
 3 files changed, 35 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..1bf2d0572f047
--- /dev/null
+++ b/drivers/gpu/drm/radeon/r600.h
@@ -0,0 +1,33 @@
+/* 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__
+
+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 14/30] drm/radeon/evergreen_dma: Fix doc-rot of function parameter 'resv'

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

 drivers/gpu/drm/radeon/evergreen_dma.c:112: warning: Function parameter or 
member 'resv' not described in 'evergreen_copy_dma'
 drivers/gpu/drm/radeon/evergreen_dma.c:112: warning: Excess function parameter 
'fence' description in 'evergreen_copy_dma'

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/evergreen_dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/evergreen_dma.c 
b/drivers/gpu/drm/radeon/evergreen_dma.c
index a46ee6c2099dd..767857d4a8c5c 100644
--- a/drivers/gpu/drm/radeon/evergreen_dma.c
+++ b/drivers/gpu/drm/radeon/evergreen_dma.c
@@ -98,7 +98,7 @@ void evergreen_dma_ring_ib_execute(struct radeon_device *rdev,
  * @src_offset: src GPU address
  * @dst_offset: dst GPU address
  * @num_gpu_pages: number of GPU pages to xfer
- * @fence: radeon fence object
+ * @resv: reservation object with embedded fence
  *
  * Copy GPU paging using the DMA engine (evergreen-cayman).
  * Used by the radeon ttm implementation to move pages if
-- 
2.25.1

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


[PATCH 08/30] drm/radeon/ci_dpm: Remove set but unused variable 'dpm_event_src'

2020-11-10 Thread Lee Jones
And the piece of code that has never been executed.

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

 drivers/gpu/drm/radeon/ci_dpm.c: In function ‘ci_set_dpm_event_sources’:
 drivers/gpu/drm/radeon/ci_dpm.c:1369:28: warning: variable ‘dpm_event_src’ set 
but not used [-Wunused-but-set-variable]

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 | 12 
 1 file changed, 12 deletions(-)

diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c
index 886e9959496fe..8324aca5fd006 100644
--- a/drivers/gpu/drm/radeon/ci_dpm.c
+++ b/drivers/gpu/drm/radeon/ci_dpm.c
@@ -1366,7 +1366,6 @@ static void ci_set_dpm_event_sources(struct radeon_device 
*rdev, u32 sources)
 {
struct ci_power_info *pi = ci_get_pi(rdev);
bool want_thermal_protection;
-   enum radeon_dpm_event_src dpm_event_src;
u32 tmp;
 
switch (sources) {
@@ -1376,28 +1375,17 @@ static void ci_set_dpm_event_sources(struct 
radeon_device *rdev, u32 sources)
break;
case (1 << RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL):
want_thermal_protection = true;
-   dpm_event_src = RADEON_DPM_EVENT_SRC_DIGITAL;
break;
case (1 << RADEON_DPM_AUTO_THROTTLE_SRC_EXTERNAL):
want_thermal_protection = true;
-   dpm_event_src = RADEON_DPM_EVENT_SRC_EXTERNAL;
break;
case ((1 << RADEON_DPM_AUTO_THROTTLE_SRC_EXTERNAL) |
  (1 << RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL)):
want_thermal_protection = true;
-   dpm_event_src = RADEON_DPM_EVENT_SRC_DIGIAL_OR_EXTERNAL;
break;
}
 
if (want_thermal_protection) {
-#if 0
-   /* XXX: need to figure out how to handle this properly */
-   tmp = RREG32_SMC(CG_THERMAL_CTRL);
-   tmp &= DPM_EVENT_SRC_MASK;
-   tmp |= DPM_EVENT_SRC(dpm_event_src);
-   WREG32_SMC(CG_THERMAL_CTRL, tmp);
-#endif
-
tmp = RREG32_SMC(GENERAL_PWRMGT);
if (pi->thermal_protection)
tmp &= ~THERMAL_PROTECTION_DIS;
-- 
2.25.1

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


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

2020-11-10 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 06/30] drm/radeon/trinity_dpm: Remove some defined but never used arrays

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

 drivers/gpu/drm/radeon/trinity_dpm.c:146:18: warning: ‘trinity_sysls_default’ 
defined but not used [-Wunused-const-variable=]
 drivers/gpu/drm/radeon/trinity_dpm.c:131:18: warning: 
‘trinity_mgcg_shls_disable’ defined but not used [-Wunused-const-variable=]
 drivers/gpu/drm/radeon/trinity_dpm.c:120:18: warning: 
‘trinity_mgcg_shls_enable’ defined but not used [-Wunused-const-variable=]

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/trinity_dpm.c | 44 
 1 file changed, 44 deletions(-)

diff --git a/drivers/gpu/drm/radeon/trinity_dpm.c 
b/drivers/gpu/drm/radeon/trinity_dpm.c
index 4d93b84aa7397..e005c18aac00e 100644
--- a/drivers/gpu/drm/radeon/trinity_dpm.c
+++ b/drivers/gpu/drm/radeon/trinity_dpm.c
@@ -116,55 +116,11 @@ static const u32 trinity_mgcg_shls_default[] =
0x9220, 0x00090008, 0x,
0x9294, 0x, 0x
 };
-
-static const u32 trinity_mgcg_shls_enable[] =
-{
-   /* Register, Value, Mask */
-   0x802c, 0xc000, 0x,
-   0x08f8, 0x, 0x,
-   0x08fc, 0x, 0x000133FF,
-   0x08f8, 0x0001, 0x,
-   0x08fc, 0x, 0xE00B03FC,
-   0x9150, 0x96944200, 0x
-};
-
-static const u32 trinity_mgcg_shls_disable[] =
-{
-   /* Register, Value, Mask */
-   0x802c, 0xc000, 0x,
-   0x9150, 0x0060, 0x,
-   0x08f8, 0x, 0x,
-   0x08fc, 0x, 0x000133FF,
-   0x08f8, 0x0001, 0x,
-   0x08fc, 0x, 0xE00B03FC
-};
 #endif
 
 #ifndef TRINITY_SYSLS_SEQUENCE
 #define TRINITY_SYSLS_SEQUENCE  100
 
-static const u32 trinity_sysls_default[] =
-{
-   /* Register, Value, Mask */
-   0x55e8, 0x, 0x,
-   0xd0bc, 0x, 0x,
-   0xd8bc, 0x, 0x,
-   0x15c0, 0x000c1401, 0x,
-   0x264c, 0x000c0400, 0x,
-   0x2648, 0x000c0400, 0x,
-   0x2650, 0x000c0400, 0x,
-   0x20b8, 0x000c0400, 0x,
-   0x20bc, 0x000c0400, 0x,
-   0x20c0, 0x000c0c80, 0x,
-   0xf4a0, 0x00c0, 0x,
-   0xf4a4, 0x00680fff, 0x,
-   0x2f50, 0x0404, 0x,
-   0x04c8, 0x0001, 0x,
-   0x641c, 0x, 0x,
-   0x0c7c, 0x, 0x,
-   0x6dfc, 0x, 0x
-};
-
 static const u32 trinity_sysls_disable[] =
 {
/* Register, Value, Mask */
-- 
2.25.1

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


[PATCH 10/30] drm/radeon/radeon_sync: Add description for function param 'rdev'

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

 drivers/gpu/drm/radeon/radeon_sync.c:92: warning: Function parameter or member 
'rdev' not described in 'radeon_sync_resv'

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_sync.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/radeon/radeon_sync.c 
b/drivers/gpu/drm/radeon/radeon_sync.c
index 55cc77a73c7b7..5d3302945076b 100644
--- a/drivers/gpu/drm/radeon/radeon_sync.c
+++ b/drivers/gpu/drm/radeon/radeon_sync.c
@@ -79,6 +79,7 @@ void radeon_sync_fence(struct radeon_sync *sync,
 /**
  * radeon_sync_resv - use the semaphores to sync to a reservation object
  *
+ * @rdev: radeon_device pointer
  * @sync: sync object to add fences from reservation object to
  * @resv: reservation object with embedded fence
  * @shared: true if we should only sync to the exclusive fence
-- 
2.25.1

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


Re: [PATCH] amd/display/amdgpu_dm: delete same check in if condition

2020-11-10 Thread Alex Deucher
Applied.  Thanks!

Alex

On Tue, Nov 10, 2020 at 9:13 AM Harry Wentland  wrote:
>
> On 2020-11-10 3:03 a.m., Bernard Zhao wrote:
> > In function amdgpu_dm_connector_get_modes, drm_edid_is_valid
> > will check weather (!edid), no need to check again in the if
> > branch.
> >
> > Signed-off-by: Bernard Zhao 
>
> Reviewed-by: Harry Wentland 
>
> Harry
>
> > ---
> >   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
> > b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> > index e93e18c06c0e..0a283d07fe10 100644
> > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> > @@ -6352,7 +6352,7 @@ static int amdgpu_dm_connector_get_modes(struct 
> > drm_connector *connector)
> >
> >   encoder = amdgpu_dm_connector_to_encoder(connector);
> >
> > - if (!edid || !drm_edid_is_valid(edid)) {
> > + if (!drm_edid_is_valid(edid)) {
> >   amdgpu_dm_connector->num_modes =
> >   drm_add_modes_noedid(connector, 640, 480);
> >   } else {
> >
> ___
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH v2 5/8] drm/amdgpu: Refactor sysfs removal

2020-11-10 Thread Greg KH
On Tue, Nov 10, 2020 at 12:54:21PM -0500, Andrey Grodzovsky wrote:
> Hi, back to this after a long context switch for some higher priority stuff.
> 
> So here I was able eventually to drop all this code and this change here 
> https://cgit.freedesktop.org/~agrodzov/linux/commit/?h=amd-staging-drm-next-device-unplug=61852c8a59b4dd89d637693552c73175b9f2ccd6
> was enough for me. Seems like while device_remove_file can handle the use
> case where the file and the parent directory already gone,
> sysfs_remove_group goes down in flames in that case
> due to kobj->sd being unset on device removal.

A driver shouldn't ever have to remove individual sysfs groups, the
driver core/bus logic should do it for them automatically.

And whenever a driver calls a sysfs_* call, that's a hint that something
is not working properly.

Also, run your patch above through checkpatch.pl before submitting it :)

thanks,

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


Re: [PATCH] drm/amdgpu: enable 48-bit IH timestamp counter

2020-11-10 Thread philip yang

  
Hi Alex,
Please update vega10_ih.c as well.
Thanks,

Philip

On 2020-11-09 10:20 p.m., Alex Sierra
  wrote:


  By default this timestamp is based on a 32 bit counter.
This is used by the amdgpu_gmc_filter_faults, to
avoid process the same interrupt in retry configuration.
Apparently there's a problem when the timestamp coming from
IH overflows and compares against timestamp coming from the
the hash table.
This patch only extends the time overflow from 10 minutes to
aprx 455 days.

Signed-off-by: Alex Sierra 
---
 drivers/gpu/drm/amd/amdgpu/navi10_ih.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
index 837769fcb35b..bda916f33805 100644
--- a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
+++ b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
@@ -94,6 +94,8 @@ static void navi10_ih_enable_interrupts(struct amdgpu_device *adev)
 
 	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, RB_ENABLE, 1);
 	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, ENABLE_INTR, 1);
+	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
+   RB_GPU_TS_ENABLE, 1);
 	if (amdgpu_sriov_vf(adev) && adev->asic_type < CHIP_NAVI10) {
 		if (psp_reg_program(>psp, PSP_REG_IH_RB_CNTL, ih_rb_cntl)) {
 			DRM_ERROR("PSP program IH_RB_CNTL failed!\n");
@@ -109,6 +111,8 @@ static void navi10_ih_enable_interrupts(struct amdgpu_device *adev)
 		ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING1);
 		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
 	   RB_ENABLE, 1);
+		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
+	   RB_GPU_TS_ENABLE, 1);
 		if (amdgpu_sriov_vf(adev) && adev->asic_type < CHIP_NAVI10) {
 			if (psp_reg_program(>psp, PSP_REG_IH_RB_CNTL_RING1,
 		ih_rb_cntl)) {
@@ -125,6 +129,8 @@ static void navi10_ih_enable_interrupts(struct amdgpu_device *adev)
 		ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING2);
 		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
 	   RB_ENABLE, 1);
+		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
+	   RB_GPU_TS_ENABLE, 1);
 		if (amdgpu_sriov_vf(adev) && adev->asic_type < CHIP_NAVI10) {
 			if (psp_reg_program(>psp, PSP_REG_IH_RB_CNTL_RING2,
 		ih_rb_cntl)) {


  

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


RE: [PATCH] drm/amdgpu: enable 48-bit IH timestamp counter

2020-11-10 Thread Sierra Guiza, Alejandro (Alex)
[AMD Public Use]

I just added support for vega10_ih too.

Regards,
Alex

> -Original Message-
> From: Sierra Guiza, Alejandro (Alex) 
> Sent: Tuesday, November 10, 2020 11:55 AM
> To: amd-gfx@lists.freedesktop.org
> Cc: Koenig, Christian ; Kuehling, Felix
> ; Sierra Guiza, Alejandro (Alex)
> 
> Subject: [PATCH] drm/amdgpu: enable 48-bit IH timestamp counter
> 
> By default this timestamp is based on a 32 bit counter.
> This is used by the amdgpu_gmc_filter_faults, to avoid process the same
> interrupt in retry configuration.
> Apparently there's a problem when the timestamp coming from IH overflows
> and compares against timestamp coming from the the hash table.
> This patch only extends the time overflow from 10 minutes to aprx 455 days.
> 
> Signed-off-by: Alex Sierra 
> ---
>  drivers/gpu/drm/amd/amdgpu/navi10_ih.c | 6 ++
> drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 6 ++
>  2 files changed, 12 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
> b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
> index 837769fcb35b..bda916f33805 100644
> --- a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
> @@ -94,6 +94,8 @@ static void navi10_ih_enable_interrupts(struct
> amdgpu_device *adev)
> 
>   ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, RB_ENABLE, 1);
>   ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, ENABLE_INTR,
> 1);
> + ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
> +RB_GPU_TS_ENABLE, 1);
>   if (amdgpu_sriov_vf(adev) && adev->asic_type < CHIP_NAVI10) {
>   if (psp_reg_program(>psp, PSP_REG_IH_RB_CNTL,
> ih_rb_cntl)) {
>   DRM_ERROR("PSP program IH_RB_CNTL failed!\n");
> @@ -109,6 +111,8 @@ static void navi10_ih_enable_interrupts(struct
> amdgpu_device *adev)
>   ih_rb_cntl = RREG32_SOC15(OSSSYS, 0,
> mmIH_RB_CNTL_RING1);
>   ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
>  RB_ENABLE, 1);
> + ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
> +RB_GPU_TS_ENABLE, 1);
>   if (amdgpu_sriov_vf(adev) && adev->asic_type <
> CHIP_NAVI10) {
>   if (psp_reg_program(>psp,
> PSP_REG_IH_RB_CNTL_RING1,
>   ih_rb_cntl)) {
> @@ -125,6 +129,8 @@ static void navi10_ih_enable_interrupts(struct
> amdgpu_device *adev)
>   ih_rb_cntl = RREG32_SOC15(OSSSYS, 0,
> mmIH_RB_CNTL_RING2);
>   ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
>  RB_ENABLE, 1);
> + ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
> +RB_GPU_TS_ENABLE, 1);
>   if (amdgpu_sriov_vf(adev) && adev->asic_type <
> CHIP_NAVI10) {
>   if (psp_reg_program(>psp,
> PSP_REG_IH_RB_CNTL_RING2,
>   ih_rb_cntl)) {
> diff --git a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
> b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
> index 407c6093c2ec..35d68bc5d95e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
> @@ -50,6 +50,8 @@ static void vega10_ih_enable_interrupts(struct
> amdgpu_device *adev)
> 
>   ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, RB_ENABLE, 1);
>   ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, ENABLE_INTR,
> 1);
> + ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
> +RB_GPU_TS_ENABLE, 1);
>   if (amdgpu_sriov_vf(adev)) {
>   if (psp_reg_program(>psp, PSP_REG_IH_RB_CNTL,
> ih_rb_cntl)) {
>   DRM_ERROR("PSP program IH_RB_CNTL failed!\n");
> @@ -64,6 +66,8 @@ static void vega10_ih_enable_interrupts(struct
> amdgpu_device *adev)
>   ih_rb_cntl = RREG32_SOC15(OSSSYS, 0,
> mmIH_RB_CNTL_RING1);
>   ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
>  RB_ENABLE, 1);
> + ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
> +RB_GPU_TS_ENABLE, 1);
>   if (amdgpu_sriov_vf(adev)) {
>   if (psp_reg_program(>psp,
> PSP_REG_IH_RB_CNTL_RING1,
>   ih_rb_cntl)) {
> @@ -80,6 +84,8 @@ static void vega10_ih_enable_interrupts(struct
> amdgpu_device *adev)
>   ih_rb_cntl = RREG32_SOC15(OSSSYS, 0,
> mmIH_RB_CNTL_RING2);
>   ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
>  RB_ENABLE, 1);
> + ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
> +RB_GPU_TS_ENABLE, 1);
>   if (amdgpu_sriov_vf(adev)) {
>   if 

[PATCH] drm/amdgpu: enable 48-bit IH timestamp counter

2020-11-10 Thread Alex Sierra
By default this timestamp is based on a 32 bit counter.
This is used by the amdgpu_gmc_filter_faults, to
avoid process the same interrupt in retry configuration.
Apparently there's a problem when the timestamp coming from
IH overflows and compares against timestamp coming from the
the hash table.
This patch only extends the time overflow from 10 minutes to
aprx 455 days.

Signed-off-by: Alex Sierra 
---
 drivers/gpu/drm/amd/amdgpu/navi10_ih.c | 6 ++
 drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 6 ++
 2 files changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c 
b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
index 837769fcb35b..bda916f33805 100644
--- a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
+++ b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
@@ -94,6 +94,8 @@ static void navi10_ih_enable_interrupts(struct amdgpu_device 
*adev)
 
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, RB_ENABLE, 1);
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, ENABLE_INTR, 1);
+   ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
+  RB_GPU_TS_ENABLE, 1);
if (amdgpu_sriov_vf(adev) && adev->asic_type < CHIP_NAVI10) {
if (psp_reg_program(>psp, PSP_REG_IH_RB_CNTL, 
ih_rb_cntl)) {
DRM_ERROR("PSP program IH_RB_CNTL failed!\n");
@@ -109,6 +111,8 @@ static void navi10_ih_enable_interrupts(struct 
amdgpu_device *adev)
ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING1);
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
   RB_ENABLE, 1);
+   ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
+  RB_GPU_TS_ENABLE, 1);
if (amdgpu_sriov_vf(adev) && adev->asic_type < CHIP_NAVI10) {
if (psp_reg_program(>psp, 
PSP_REG_IH_RB_CNTL_RING1,
ih_rb_cntl)) {
@@ -125,6 +129,8 @@ static void navi10_ih_enable_interrupts(struct 
amdgpu_device *adev)
ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING2);
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
   RB_ENABLE, 1);
+   ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
+  RB_GPU_TS_ENABLE, 1);
if (amdgpu_sriov_vf(adev) && adev->asic_type < CHIP_NAVI10) {
if (psp_reg_program(>psp, 
PSP_REG_IH_RB_CNTL_RING2,
ih_rb_cntl)) {
diff --git a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c 
b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
index 407c6093c2ec..35d68bc5d95e 100644
--- a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
+++ b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
@@ -50,6 +50,8 @@ static void vega10_ih_enable_interrupts(struct amdgpu_device 
*adev)
 
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, RB_ENABLE, 1);
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, ENABLE_INTR, 1);
+   ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
+  RB_GPU_TS_ENABLE, 1);
if (amdgpu_sriov_vf(adev)) {
if (psp_reg_program(>psp, PSP_REG_IH_RB_CNTL, 
ih_rb_cntl)) {
DRM_ERROR("PSP program IH_RB_CNTL failed!\n");
@@ -64,6 +66,8 @@ static void vega10_ih_enable_interrupts(struct amdgpu_device 
*adev)
ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING1);
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
   RB_ENABLE, 1);
+   ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
+  RB_GPU_TS_ENABLE, 1);
if (amdgpu_sriov_vf(adev)) {
if (psp_reg_program(>psp, 
PSP_REG_IH_RB_CNTL_RING1,
ih_rb_cntl)) {
@@ -80,6 +84,8 @@ static void vega10_ih_enable_interrupts(struct amdgpu_device 
*adev)
ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING2);
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
   RB_ENABLE, 1);
+   ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
+  RB_GPU_TS_ENABLE, 1);
if (amdgpu_sriov_vf(adev)) {
if (psp_reg_program(>psp, 
PSP_REG_IH_RB_CNTL_RING2,
ih_rb_cntl)) {
-- 
2.17.1

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


Re: [PATCH v2 5/8] drm/amdgpu: Refactor sysfs removal

2020-11-10 Thread Andrey Grodzovsky

Hi, back to this after a long context switch for some higher priority stuff.

So here I was able eventually to drop all this code and this change here 
https://cgit.freedesktop.org/~agrodzov/linux/commit/?h=amd-staging-drm-next-device-unplug=61852c8a59b4dd89d637693552c73175b9f2ccd6
was enough for me. Seems like while device_remove_file can handle the use case 
where the file and the parent directory already gone, sysfs_remove_group goes 
down in flames in that case

due to kobj->sd being unset on device removal.

Andrey

On 6/24/20 2:11 AM, Greg KH wrote:

But why are things being removed twice?

Not sure I understand what removed twice ? I remove only once per sysfs 
attribute.

This code path shows that the kernel is trying to remove a file that is
not present, so someone removed it already...

thanks,

gre k-h

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


Re: [PATCH v2 2/8] drm/ttm: Remap all page faults to per process dummy page.

2020-11-10 Thread Andrey Grodzovsky



On 6/22/20 5:41 AM, Daniel Vetter wrote:

On Sun, Jun 21, 2020 at 02:03:02AM -0400, Andrey Grodzovsky wrote:

On device removal reroute all CPU mappings to dummy page per drm_file
instance or imported GEM object.

Signed-off-by: Andrey Grodzovsky 
---
  drivers/gpu/drm/ttm/ttm_bo_vm.c | 65 -
  1 file changed, 57 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c b/drivers/gpu/drm/ttm/ttm_bo_vm.c
index 389128b..2f8bf5e 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_vm.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c
@@ -35,6 +35,8 @@
  #include 
  #include 
  #include 
+#include 
+#include 
  #include 
  #include 
  #include 
@@ -328,19 +330,66 @@ vm_fault_t ttm_bo_vm_fault(struct vm_fault *vmf)

Hm I think diff and code flow look a bit bad now. What about renaming the
current function to __ttm_bo_vm_fault and then having something like the
below:

ttm_bo_vm_fault(args) {

if (drm_dev_enter()) {
__ttm_bo_vm_fault(args);
drm_dev_exit();
} else  {
drm_gem_insert_dummy_pfn();
}
}

I think drm_gem_insert_dummy_pfn(); should be portable across drivers, so
another nice point to try to unifiy drivers as much as possible.
-Daniel


pgprot_t prot;
struct ttm_buffer_object *bo = vma->vm_private_data;
vm_fault_t ret;
+   int idx;
+   struct drm_device *ddev = bo->base.dev;
  
-	ret = ttm_bo_vm_reserve(bo, vmf);

-   if (ret)
-   return ret;
+   if (drm_dev_enter(ddev, )) {
+   ret = ttm_bo_vm_reserve(bo, vmf);
+   if (ret)
+   goto exit;
+
+   prot = vma->vm_page_prot;
  
-	prot = vma->vm_page_prot;

-   ret = ttm_bo_vm_fault_reserved(vmf, prot, TTM_BO_VM_NUM_PREFAULT);
-   if (ret == VM_FAULT_RETRY && !(vmf->flags & FAULT_FLAG_RETRY_NOWAIT))
+   ret = ttm_bo_vm_fault_reserved(vmf, prot, 
TTM_BO_VM_NUM_PREFAULT);
+   if (ret == VM_FAULT_RETRY && !(vmf->flags & 
FAULT_FLAG_RETRY_NOWAIT))
+   goto exit;
+
+   dma_resv_unlock(bo->base.resv);
+
+exit:
+   drm_dev_exit(idx);
return ret;
+   } else {
  
-	dma_resv_unlock(bo->base.resv);

+   struct drm_file *file = NULL;
+   struct page *dummy_page = NULL;
+   int handle;
  
-	return ret;

+   /* We are faulting on imported BO from dma_buf */
+   if (bo->base.dma_buf && bo->base.import_attach) {
+   dummy_page = bo->base.dummy_page;
+   /* We are faulting on non imported BO, find drm_file owning the 
BO*/

Uh, we can't fish that out of the vma->vm_file pointer somehow? Or is that
one all wrong? Doing this kind of list walk looks pretty horrible.

If the vma doesn't have the right pointer I guess next option is that we
store the drm_file page in gem_bo->dummy_page, and replace it on first
export. But that's going to be tricky to track ...



For this one I hope to make all of this obsolete if Christian's suggestion from 
path 1/8 about mapping
global RO dummy page for read and COW on write will be possible to implement 
(testing

that indeed no memory usage explodes)

Andrey





+   } else {
+   struct drm_gem_object *gobj;
+
+   mutex_lock(>filelist_mutex);
+   list_for_each_entry(file, >filelist, lhead) {
+   spin_lock(>table_lock);
+   idr_for_each_entry(>object_idr, gobj, 
handle) {
+   if (gobj == >base) {
+   dummy_page = file->dummy_page;
+   break;
+   }
+   }
+   spin_unlock(>table_lock);
+   }
+   mutex_unlock(>filelist_mutex);
+   }
+
+   if (dummy_page) {
+   /*
+* Let do_fault complete the PTE install e.t.c using 
vmf->page
+*
+* TODO - should i call free_page somewhere ?

Nah, instead don't call get_page. The page will be around as long as
there's a reference for the drm_file or gem_bo, which is longer than any
mmap. Otherwise yes this would like really badly.


+*/
+   get_page(dummy_page);
+   vmf->page = dummy_page;
+   return 0;
+   } else {
+   return VM_FAULT_SIGSEGV;

Hm that would be a kernel bug, wouldn't it? WARN_ON() required here imo.
-Daniel


+   }
+   }
  }
  EXPORT_SYMBOL(ttm_bo_vm_fault);
  
--

2.7.4


___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org

Re: [PATCH] drm/amd/pm: Use kmemdup instead of kmalloc and memcpy

2020-11-10 Thread Alex Deucher
On Tue, Nov 10, 2020 at 11:57 AM Tian Tao  wrote:
>
> Fixes coccicheck warning:
> drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c:255:
> 36-43: WARNING opportunity for kmemdup
>
> Signed-off-by: Tian Tao 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c 
> b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c
> index 740e2fc..1e79baa 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c
> @@ -252,12 +252,11 @@ static int init_powerplay_table_information(
> phm_copy_clock_limits_array(hwmgr, 
> _information->power_saving_clock_max, 
> powerplay_table->PowerSavingClockMax, ATOM_VEGA12_PPCLOCK_COUNT);
> phm_copy_clock_limits_array(hwmgr, 
> _information->power_saving_clock_min, 
> powerplay_table->PowerSavingClockMin, ATOM_VEGA12_PPCLOCK_COUNT);
>
> -   pptable_information->smc_pptable = kmalloc(sizeof(PPTable_t), 
> GFP_KERNEL);
> +   pptable_information->smc_pptable = 
> kmemdup(&(powerplay_table->smcPPTable),
> +  sizeof(PPTable_t), 
> GFP_KERNEL);
> if (pptable_information->smc_pptable == NULL)
> return -ENOMEM;
>
> -   memcpy(pptable_information->smc_pptable, 
> &(powerplay_table->smcPPTable), sizeof(PPTable_t));
> -
> result = append_vbios_pptable(hwmgr, 
> (pptable_information->smc_pptable));
>
> return result;
> --
> 2.7.4
>
> ___
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: Subject: [RFC] clang tooling cleanups

2020-11-10 Thread Tom Rix

On 11/9/20 6:52 PM, Joe Perches wrote:
> On Tue, 2020-10-27 at 09:42 -0700, t...@redhat.com wrote:
>> This rfc will describe
>> An upcoming treewide cleanup.
>> How clang tooling was used to programatically do the clean up.
>> Solicit opinions on how to generally use clang tooling.
>>
>> The clang warning -Wextra-semi-stmt produces about 10k warnings.
>> Reviewing these, a subset of semicolon after a switch looks safe to
>> fix all the time.  An example problem
>>
>> void foo(int a) {
>>  switch(a) {
>>     case 1:
>> ...
>>  }; <--- extra semicolon
>> }
>>
>> Treewide, there are about 100 problems in 50 files for x86_64 allyesconfig.
>> These fixes will be the upcoming cleanup.
> coccinelle already does some of these.
>
> For instance: scripts/coccinelle/misc/semicolon.cocci
>
> Perhaps some tool coordination can be done here as
> coccinelle/checkpatch/clang/Lindent call all be used
> to do some facet or another of these cleanup issues.

Thanks for pointing this out.

I will take a look at it.

Tom

>
>

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


Re: [PATCH RFC PKS/PMEM 05/58] kmap: Introduce k[un]map_thread

2020-11-10 Thread Thomas Gleixner
On Mon, Nov 09 2020 at 20:59, Ira Weiny wrote:
> On Tue, Nov 10, 2020 at 02:13:56AM +0100, Thomas Gleixner wrote:
> Also, we can convert the new memcpy_*_page() calls to kmap_local() as well.
> [For now my patch just uses kmap_atomic().]
>
> I've not looked at all of the patches in your latest version.  Have you
> included converting any of the kmap() call sites?  I thought you were more
> focused on converting the kmap_atomic() to kmap_local()?

I did not touch any of those yet, but it's a logical consequence to
convert all kmap() instances which are _not_ creating a global mapping
over to it.

Thanks,

tglx

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


Re: [PATCH 15/20] drm/radeon/r600d: Move 'rc600_*' prototypes into shared header

2020-11-10 Thread Lee Jones
On Tue, 10 Nov 2020, Sam Ravnborg wrote:

> Hi Lee,
> 
> > > the *d.h headers are supposed to just be hardware definitions.  I'd
> > > prefer to keep driver stuff out of them.
> > 
> > That's fine (I did wonder if that were the case).
> > 
> > I need an answer from you and Sam whether I can create new headers.
> > 
> > For me, it is the right thing to do.
> 
> Please follow the advice of Alex for the radeon driver.

Great.  Thanks for resolving this Sam.

Will fix all occurrences.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH] drm/amd/pm: Use kmemdup instead of kmalloc and memcpy

2020-11-10 Thread Tian Tao
Fixes coccicheck warning:
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c:255:
36-43: WARNING opportunity for kmemdup

Signed-off-by: Tian Tao 
---
 drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c 
b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c
index 740e2fc..1e79baa 100644
--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c
@@ -252,12 +252,11 @@ static int init_powerplay_table_information(
phm_copy_clock_limits_array(hwmgr, 
_information->power_saving_clock_max, 
powerplay_table->PowerSavingClockMax, ATOM_VEGA12_PPCLOCK_COUNT);
phm_copy_clock_limits_array(hwmgr, 
_information->power_saving_clock_min, 
powerplay_table->PowerSavingClockMin, ATOM_VEGA12_PPCLOCK_COUNT);
 
-   pptable_information->smc_pptable = kmalloc(sizeof(PPTable_t), 
GFP_KERNEL);
+   pptable_information->smc_pptable = 
kmemdup(&(powerplay_table->smcPPTable),
+  sizeof(PPTable_t), 
GFP_KERNEL);
if (pptable_information->smc_pptable == NULL)
return -ENOMEM;
 
-   memcpy(pptable_information->smc_pptable, 
&(powerplay_table->smcPPTable), sizeof(PPTable_t));
-
result = append_vbios_pptable(hwmgr, 
(pptable_information->smc_pptable));
 
return result;
-- 
2.7.4

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


Re: [PATCH] drm/amd/display: Fix memory leaks in S3 resume

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

Ah, sorry, I missed that part of the patch.

Alex


From: Wentland, Harry 
Sent: Tuesday, November 10, 2020 11:42 AM
To: Deucher, Alexander ; Wang, Chao-kai (Stylon) 
; amd-gfx@lists.freedesktop.org 

Cc: Kazlauskas, Nicholas 
Subject: Re: [PATCH] drm/amd/display: Fix memory leaks in S3 resume

It's missing the "drm_connector_list_update" call which I assume is important.

Stylon, can you review Lee Starnes's patch? Is the drm_connector_list_update 
call maybe not needed?

Thanks,
Harry

On 2020-11-10 11:26 a.m., Deucher, Alexander wrote:

[AMD Official Use Only - Internal Distribution Only]

Lee Starnes just sent the exact same patch yesterday.  Please review that one:
https://patchwork.freedesktop.org/patch/399497/

Alex


From: Wentland, Harry 
Sent: Tuesday, November 10, 2020 9:27 AM
To: Wang, Chao-kai (Stylon) ; 
amd-gfx@lists.freedesktop.org 

Cc: Kazlauskas, Nicholas 
; Deucher, 
Alexander 
Subject: Re: [PATCH] drm/amd/display: Fix memory leaks in S3 resume

On 2020-11-10 2:49 a.m., Stylon Wang wrote:
> EDID parsing in S3 resume pushes new display modes
> to probed_modes list but doesn't consolidate to actual
> mode list. This creates a race condition when
> amdgpu_dm_connector_ddc_get_modes() re-initializes the
> list head without walking the list and results in  memory leak.
>
> Signed-off-by: Stylon Wang 

Looks reasonable to me but haven't had a chance to understand whether
this is the best solution.

Acked-by: Harry Wentland 

Harry

> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 0b6adf23d316..715e0bd489f8 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -2337,7 +2337,8 @@ void amdgpu_dm_update_connector_after_detect(
>
>drm_connector_update_edid_property(connector,
>   aconnector->edid);
> - drm_add_edid_modes(connector, aconnector->edid);
> + aconnector->num_modes = drm_add_edid_modes(connector, 
> aconnector->edid);
> + drm_connector_list_update(connector);
>
>if (aconnector->dc_link->aux_mode)
>drm_dp_cec_set_edid(>dm_dp_aux.aux,
>

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


Re: [PATCH] drm/amd/display: Fix memory leaks in S3 resume

2020-11-10 Thread Harry Wentland
It's missing the "drm_connector_list_update" call which I assume is 
important.


Stylon, can you review Lee Starnes's patch? Is the 
drm_connector_list_update call maybe not needed?


Thanks,
Harry

On 2020-11-10 11:26 a.m., Deucher, Alexander wrote:


[AMD Official Use Only - Internal Distribution Only]


Lee Starnes just sent the exact same patch yesterday.  Please review 
that one:
https://patchwork.freedesktop.org/patch/399497/ 



Alex


*From:* Wentland, Harry 
*Sent:* Tuesday, November 10, 2020 9:27 AM
*To:* Wang, Chao-kai (Stylon) ; 
amd-gfx@lists.freedesktop.org 
*Cc:* Kazlauskas, Nicholas ; Deucher, 
Alexander 

*Subject:* Re: [PATCH] drm/amd/display: Fix memory leaks in S3 resume
On 2020-11-10 2:49 a.m., Stylon Wang wrote:
> EDID parsing in S3 resume pushes new display modes
> to probed_modes list but doesn't consolidate to actual
> mode list. This creates a race condition when
> amdgpu_dm_connector_ddc_get_modes() re-initializes the
> list head without walking the list and results in memory leak.
>
> Signed-off-by: Stylon Wang 

Looks reasonable to me but haven't had a chance to understand whether
this is the best solution.

Acked-by: Harry Wentland 

Harry

> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

> index 0b6adf23d316..715e0bd489f8 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -2337,7 +2337,8 @@ void amdgpu_dm_update_connector_after_detect(
>
> drm_connector_update_edid_property(connector,
>  aconnector->edid);
> - drm_add_edid_modes(connector, aconnector->edid);
> + aconnector->num_modes = 
drm_add_edid_modes(connector, aconnector->edid);

> + drm_connector_list_update(connector);
>
>    if (aconnector->dc_link->aux_mode)
> drm_dp_cec_set_edid(>dm_dp_aux.aux,
>


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


  1   2   >